:root {
  --bg: #141619;
  --surface: #24262a;
  --surface-2: #1b1e22;
  --surface-3: #2d3035;
  --gold: #d4af69;
  --gold-soft: #ead4a6;
  --text: #f6f2e8;
  --muted: #b8b2a7;
  --danger: #e27b82;
  --success: #81c9a4;
  --border: rgba(212, 175, 105, .22);
  --shadow: 0 18px 44px rgba(0, 0, 0, .32);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; overflow-x: hidden; }
body {
  margin: 0;
  padding-bottom: calc(92px + var(--tg-safe-bottom, 0px));
  background:
    radial-gradient(circle at 15% 5%, rgba(212, 175, 105, .1), transparent 35%),
    radial-gradient(circle at 95% 60%, rgba(111, 77, 44, .16), transparent 38%),
    var(--bg);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.hidden { display: none !important; }
.ambient { position: fixed; pointer-events: none; filter: blur(20px); opacity: .22; }
.ambient-one { width: 220px; height: 220px; border-radius: 50%; background: #7f5c2e; top: -120px; right: -80px; }
.ambient-two { width: 180px; height: 180px; border-radius: 50%; background: #4b3d2f; bottom: 180px; left: -130px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--tg-safe-top, 0px)) 18px 12px;
  background: rgba(20, 22, 25, .84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(212, 175, 105, .08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}
.brand b { display: block; font-size: 18px; letter-spacing: .02em; }
.brand small { display: block; color: var(--muted); margin-top: 2px; font-size: 11px; }
.brand-mark { position: relative; width: 38px; height: 38px; display: inline-block; }
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  width: 23px;
  height: 32px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  top: 3px;
}
.brand-mark::before { left: 2px; transform: rotate(-24deg); }
.brand-mark::after { right: 2px; transform: rotate(24deg); }
.brand-mark i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-soft);
  left: 17px;
  top: 16px;
}
.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  color: var(--gold-soft);
  background: rgba(36, 38, 42, .82);
}

main { max-width: 780px; margin: 0 auto; padding: 14px 14px 24px; }
.view { animation: appear .2s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.section-head, .view-toolbar { margin: 8px 2px 18px; }
.view-toolbar { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(27px, 8vw, 40px); line-height: 1.03; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 22px; }
h3 { margin: 0; font-size: 20px; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.panel {
  background: linear-gradient(160deg, rgba(48, 48, 50, .92), rgba(32, 34, 38, .96));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.progress { height: 5px; border-radius: 999px; background: var(--surface-2); margin-bottom: 14px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #a98548, var(--gold-soft)); transition: width .25s ease; }
.field { margin: 15px 0; }
.field:first-child { margin-top: 0; }
.field label, .field legend { display: block; margin-bottom: 7px; color: var(--text); font-size: 13px; font-weight: 700; }
.field small { display: block; color: var(--muted); margin-top: 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(15, 16, 19, .72);
}
textarea { min-height: 112px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 16px 0; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.choice { position: relative; }
.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}
.choice span {
  display: block;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(20, 22, 25, .74);
  text-align: center;
}
.choice input:checked + span { border-color: var(--gold); color: var(--gold-soft); background: rgba(212, 175, 105, .1); }
.field-error { min-height: 20px; margin: 10px 0; color: var(--danger); font-size: 13px; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; }
.actions.split { justify-content: space-between; }
.primary, .secondary, .danger-button, .quiet {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 13px 17px;
  font-weight: 750;
}
.primary { color: #18150f; background: linear-gradient(135deg, #c39b52, #e7ce99); }
.secondary { color: var(--gold-soft); border-color: var(--border); background: var(--surface-2); }
.quiet { color: var(--muted); background: transparent; }
.danger-button { color: #fff; background: #743e43; }
.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--gold-soft);
  background: rgba(36, 38, 42, .88);
  font-weight: 700;
}
.feed-tools { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.card-grid { display: grid; gap: 14px; }
.card-grid.list { grid-template-columns: 1fr; }
@media (min-width: 680px) { .card-grid:not(.list) { grid-template-columns: 1fr 1fr; } }
.profile-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--surface-3), var(--surface));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.profile-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: var(--surface-2); }
.profile-body { padding: 16px; }
.profile-body h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.profile-body h3 span { color: var(--muted); font-size: 15px; font-weight: 500; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.fact { padding: 6px 9px; border-radius: 999px; background: rgba(212, 175, 105, .09); color: var(--gold-soft); font-size: 12px; }
.profile-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.profile-actions button { flex: 1; min-width: 110px; }
.empty, .error-state {
  min-height: 190px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: 22px;
  color: var(--muted);
}
.notice { padding: 12px 14px; border-radius: 14px; margin: 0 0 14px; font-size: 13px; line-height: 1.45; }
.notice-wait { color: #e8d4a7; background: rgba(212, 175, 105, .11); border: 1px solid rgba(212, 175, 105, .22); }
.notice-error { color: #ffc4c7; background: rgba(226, 123, 130, .12); border: 1px solid rgba(226, 123, 130, .25); }
.notice-ok { color: #c9f0db; background: rgba(129, 201, 164, .1); border: 1px solid rgba(129, 201, 164, .22); }
.segmented { display: flex; padding: 4px; margin-bottom: 14px; border-radius: 15px; background: var(--surface-2); border: 1px solid rgba(255, 255, 255, .05); }
.segmented button { flex: 1; border: 0; border-radius: 11px; padding: 10px 4px; color: var(--muted); background: transparent; font-size: 12px; }
.segmented button.active { color: #19160f; background: var(--gold); font-weight: 800; }
.stack { display: grid; gap: 10px; }
.list-card { display: flex; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--border); border-radius: 17px; background: rgba(36, 38, 42, .85); }
.avatar { width: 52px; height: 52px; border-radius: 16px; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; color: var(--gold); flex: 0 0 auto; }
.list-card .grow { flex: 1; min-width: 0; }
.list-card p { margin: 4px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; color: var(--gold-soft); background: rgba(212, 175, 105, .12); }
.bottom-nav {
  position: fixed;
  z-index: 10;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + var(--tg-safe-bottom, 0px));
  width: min(calc(100% - 24px), 620px);
  display: flex;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(27, 30, 34, .94);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}
.bottom-nav button { flex: 1; border: 0; border-radius: 14px; color: var(--muted); background: transparent; padding: 8px 3px 7px; font-size: 10px; }
.bottom-nav button span { display: block; font-size: 20px; line-height: 1.2; margin-bottom: 2px; }
.bottom-nav button.active { color: var(--gold-soft); background: rgba(212, 175, 105, .1); }
.sheet-backdrop { position: fixed; z-index: 20; inset: 0; background: rgba(0, 0, 0, .64); backdrop-filter: blur(3px); }
.sheet {
  position: fixed;
  z-index: 21;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 680px);
  max-height: 88vh;
  overflow: auto;
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--border);
  background: #1a1d20;
  padding: 10px 16px calc(24px + var(--tg-safe-bottom, 0px));
}
.sheet-handle { width: 44px; height: 4px; border-radius: 99px; background: #4d4f52; margin: 0 auto 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; }
.photo-thumb { width: 98px; height: 124px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); flex: 0 0 auto; }
.photo-add { width: 98px; height: 124px; border-radius: 14px; border: 1px dashed var(--border); color: var(--gold); background: transparent; font-size: 28px; flex: 0 0 auto; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(88px + var(--tg-safe-bottom, 0px)); transform: translateX(-50%); padding: 11px 16px; border-radius: 13px; color: var(--text); background: #33363b; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.loading { position: fixed; z-index: 40; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 13px 17px; border-radius: 14px; background: #282b2f; border: 1px solid var(--border); }
.loading span { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border: 2px solid var(--muted); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.review-list { display: grid; gap: 7px; }
.review-button { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .07); background: transparent; color: var(--text); text-align: left; }
.review-button span:last-child { color: var(--muted); text-align: right; }
.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.metric { padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid rgba(255, 255, 255, .05); }
.metric b { display: block; font-size: 22px; color: var(--gold-soft); }
.metric span { color: var(--muted); font-size: 11px; }
@media (max-width: 430px) {
  .form-row { grid-template-columns: 1fr; }
  .actions.split > button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.legal-page main { max-width: 820px; padding-top: 34px; }
.legal-page .panel { margin: 18px 0; }
.legal-page .panel h2 { margin-bottom: 12px; }
.legal-page a.primary { display: inline-block; text-decoration: none; }
