:root {
  --bg: #0b0612;
  --bg-2: #120a1c;
  --card: rgba(28, 16, 40, 0.78);
  --card-solid: #1a1026;
  --line: rgba(255, 63, 191, 0.18);
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f3f1f7;
  --muted: #8d8a9b;
  --red: #ff3fbf;
  --red-2: #ff1fa6;
  --hot: #ff5e3a;
  --violet: #9b4dff;
  --amber: #ffb020;
  --green: #22f5a0;
  --cyan: #2de2ff;
  --grad: linear-gradient(135deg, #ff2fa8 0%, #e02bff 50%, #7b3dff 100%);
  --grad-hot: linear-gradient(135deg, #ff7ad9 0%, #ff2fa8 50%, #b93dff 100%);
  --glow: 0 0 18px rgba(255, 40, 180, 0.45), 0 0 42px rgba(255, 40, 180, 0.18);
  --radius: 18px;
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-logo: "Orbitron", "Unbounded", sans-serif;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

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

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100%;
  overscroll-behavior: none;
}

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 63, 191, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 63, 191, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 55%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 55%);
}
.bg-glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 520px; height: 520px; top: -260px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 31, 166, 0.32) 0%, rgba(140, 70, 255, 0.12) 45%, transparent 70%);
  filter: blur(10px);
}

#app {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
}

/* ---------- header / logo ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark {
  overflow: hidden;
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--grad); box-shadow: var(--glow);
  font-family: var(--font-logo); font-weight: 900; font-size: 15px; color: #fff;
}
.logo-text { line-height: 1.05; min-width: 0; }
.logo-text b {
  display: block; font-family: var(--font-logo); font-weight: 900; font-size: 17px; letter-spacing: 0.06em;
  background: linear-gradient(90deg, #fff 0%, #ff9be6 50%, #ff3fbf 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 22px rgba(255, 63, 191, 0.35);
}
.logo-text span {
  font-family: var(--font-logo); font-weight: 600; font-size: 10px; letter-spacing: 0.32em;
  color: var(--red); text-transform: uppercase;
}
.logo.big { flex-direction: column; text-align: center; gap: 14px; }
.logo.big .logo-mark { width: 72px; height: 72px; border-radius: 22px; font-size: 28px; }
.logo.big .logo-text b { font-size: 28px; }
.logo.big .logo-text span { font-size: 12px; }

.who {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 5px 12px 5px 5px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; max-width: 55%;
}
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- avatar ---------- */
.ava {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 14px; font-size: 22px;
  background: linear-gradient(145deg, rgba(255, 63, 191, 0.22), rgba(140, 70, 255, 0.16));
  border: 1px solid rgba(255, 63, 191, 0.35);
  box-shadow: inset 0 0 12px rgba(255, 63, 191, 0.15);
}
.ava.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 15px; }
.ava.xs { width: 22px; height: 22px; border-radius: 7px; font-size: 12px; }
.ava.lg { width: 76px; height: 76px; border-radius: 24px; font-size: 40px; box-shadow: var(--glow); }

/* ---------- cards ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.card + .card, .card + .section, .section + .card, .section + .section { margin-top: 14px; }
.card.neon {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--card-solid), var(--card-solid)) padding-box,
    var(--grad) border-box;
  box-shadow: var(--glow);
}

.balance { padding: 22px 20px; overflow: hidden; }
.balance::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255, 31, 166, 0.35), transparent 65%);
  pointer-events: none;
}
.label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.balance .amount {
  margin: 6px 0 4px;
  font-family: var(--font-display); font-weight: 700; font-size: 38px; line-height: 1.1;
  background: linear-gradient(90deg, #fff, #ffc4f0 60%, #ff3fbf);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.balance .sub { font-size: 13px; color: var(--muted); }

a, .link { color: var(--red); text-decoration: none; font-weight: 600; cursor: pointer; }

.payout { display: flex; align-items: center; gap: 12px; }
.payout .icon {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 19px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-soft);
}
.payout .info { flex: 1; min-width: 0; }
.payout .value {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.payout .value.empty { color: var(--muted); font-family: var(--font); letter-spacing: 0; }

.slogan {
  margin: 22px 2px 4px;
  font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.25;
}
.slogan em {
  font-style: normal;
  background: var(--grad-hot); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- sections & lists ---------- */
.section { margin-top: 22px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 2px 10px;
}
.section-head h3 {
  margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 14px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.section-head h3 .count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; background: var(--grad); font-family: var(--font); font-size: 11px; font-weight: 700;
  vertical-align: 2px;
}

.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: 16px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line-soft);
  transition: border-color .15s, transform .1s;
}
.item:active { transform: scale(0.985); border-color: var(--line); }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { margin-top: 3px; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.item .side { text-align: right; flex: none; }
.price {
  font-family: var(--font-display); font-weight: 700; font-size: 15px; white-space: nowrap;
  color: #fff; text-shadow: 0 0 12px rgba(255, 63, 191, 0.55);
}
.chev { color: var(--muted); font-size: 18px; flex: none; }

.empty {
  padding: 26px 16px; text-align: center; color: var(--muted); font-size: 14px;
  border: 1px dashed rgba(255, 63, 191, 0.25); border-radius: var(--radius);
}
.empty .big { font-size: 30px; display: block; margin-bottom: 6px; filter: grayscale(0.2); }

/* ---------- badges & tags ---------- */
.status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status.active { color: var(--red); background: rgba(255, 63, 191, 0.12); }
.status.review { color: var(--amber); background: rgba(255, 176, 32, 0.12); }
.status.done { color: var(--green); background: rgba(34, 245, 160, 0.1); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: #ffc8f0; background: rgba(255, 63, 191, 0.1); border: 1px solid rgba(255, 63, 191, 0.25);
}
.tag .x { cursor: pointer; opacity: 0.7; font-size: 14px; line-height: 1; margin-left: 2px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: 14px;
  font-family: var(--font); font-size: 15px; font-weight: 700; color: #fff;
  background: var(--grad); box-shadow: var(--glow);
  transition: transform .1s, filter .15s, opacity .15s;
}
.btn:active { transform: scale(0.97); filter: brightness(1.1); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost {
  background: rgba(255, 255, 255, 0.04); box-shadow: none;
  border: 1px solid rgba(255, 63, 191, 0.35); color: #ffd8f5;
}
.btn.ok { background: linear-gradient(135deg, #0fd98a, #22f5a0); color: #04130c; box-shadow: 0 0 18px rgba(34, 245, 160, 0.35); }
.btn.danger { background: rgba(255, 63, 191, 0.08); box-shadow: none; border: 1px solid rgba(255, 63, 191, 0.45); color: var(--red); }
.btn.sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.icon-btn {
  appearance: none; cursor: pointer; flex: none;
  height: 32px; padding: 0 12px; border-radius: 10px;
  background: rgba(255, 63, 191, 0.1); border: 1px solid rgba(255, 63, 191, 0.3);
  color: #ffc8f0; font-size: 12.5px; font-weight: 700; font-family: var(--font);
}

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field > label:not(.photo-pick) { display: block; margin: 0 2px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line-soft);
  color: var(--text); font-family: var(--font); font-size: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--red) 50%), linear-gradient(135deg, var(--red) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
select.input option { background: var(--card-solid); }
.input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 63, 191, 0.18); }
.input::placeholder { color: #5d5a6b; }
.hint { margin: 6px 2px 0; font-size: 12px; color: var(--muted); }
.inline { display: flex; gap: 8px; }
.inline .input { flex: 1; }
.inline .btn { height: 48px; }

.seg { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line-soft); }
.seg button {
  flex: 1; height: 38px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--muted); font-family: var(--font); font-size: 14px; font-weight: 700;
}
.seg button.on { background: var(--grad); color: #fff; box-shadow: var(--glow); }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.emoji-grid button {
  height: 42px; border-radius: 12px; cursor: pointer; font-size: 21px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line-soft);
}
.emoji-grid button.on { border-color: var(--red); background: rgba(255, 63, 191, 0.18); box-shadow: var(--glow); }

.photo-pick {
  display: grid; place-items: center; min-height: 96px; border-radius: 14px; cursor: pointer;
  border: 1px dashed rgba(255, 63, 191, 0.4); color: var(--muted); font-size: 14px; text-align: center;
  background: rgba(255, 63, 191, 0.04); overflow: hidden; position: relative;
}
.photo-pick img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.photo-pick input { display: none; }

/* ---------- login ---------- */
.login { min-height: calc(100vh - 60px); display: flex; flex-direction: column; justify-content: center; gap: 30px; padding: 20px 4px; }
.login p { margin: 0; text-align: center; color: var(--muted); }
.pin { display: flex; justify-content: center; gap: 12px; }
.pin .cell {
  width: 58px; height: 68px; border-radius: 16px; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 28px; font-weight: 700;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line-soft);
  transition: all .15s;
}
.pin .cell.filled { border-color: var(--red); box-shadow: var(--glow); background: rgba(255, 63, 191, 0.1); }
.pin.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; width: 100%; }
.keypad button {
  height: 60px; border-radius: 16px; cursor: pointer; border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.035); color: var(--text);
  font-family: var(--font-display); font-size: 22px; font-weight: 500;
}
.keypad button:active { background: rgba(255, 63, 191, 0.2); border-color: var(--red); }
.keypad button.fn { font-family: var(--font); font-size: 18px; color: var(--muted); }

/* ---------- task detail ---------- */
.detail-title { margin: 6px 0 10px; font-family: var(--font-display); font-weight: 700; font-size: 23px; line-height: 1.2; }
.detail-price {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 12px;
  background: rgba(255, 63, 191, 0.1); border: 1px solid rgba(255, 63, 191, 0.35);
}
.detail-price b { font-family: var(--font-display); font-size: 22px; text-shadow: 0 0 14px rgba(255, 63, 191, 0.6); }
.detail-price span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.desc { white-space: pre-wrap; word-wrap: break-word; color: #dcd9e4; }
.task-photo { width: 100%; border-radius: 14px; display: block; margin-top: 12px; border: 1px solid var(--line-soft); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* ---------- admin ---------- */
.tabs {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; padding: 5px; margin: 0 -2px 16px;
  border-radius: 16px; background: rgba(14, 14, 21, 0.85); border: 1px solid var(--line-soft);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.tabs button {
  flex: 1; height: 40px; border: 0; border-radius: 12px; cursor: pointer;
  background: transparent; color: var(--muted); font-family: var(--font); font-size: 13.5px; font-weight: 700;
}
.tabs button.on { background: var(--grad); color: #fff; box-shadow: var(--glow); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-soft);
}
.stat b { display: block; margin-top: 4px; font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.stat.wide { grid-column: 1 / -1; }
.stat.hero {
  border: 1px solid transparent; box-shadow: var(--glow);
  background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--grad) border-box;
}
.stat.hero b {
  font-size: 32px;
  background: linear-gradient(90deg, #fff, #ff9be6 60%, #ff3fbf); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat.review b { color: var(--amber); }
.stat.active b { color: var(--red); }
.stat.done b { color: var(--green); }

.filters { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: none; height: 32px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line-soft);
  color: var(--muted); font-family: var(--font); font-size: 13px; font-weight: 600;
}
.filters button.on { color: #fff; border-color: var(--red); background: rgba(255, 63, 191, 0.15); }

.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 21px; font-weight: 700; }
.code-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 9px; cursor: pointer;
  background: rgba(255, 63, 191, 0.1); border: 1px solid rgba(255, 63, 191, 0.35);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; font-weight: 700; letter-spacing: .2em;
}
.code-pill small { font-family: var(--font); letter-spacing: 0; color: var(--muted); font-size: 11px; font-weight: 600; }

.fab-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

.footer-links { margin-top: 28px; text-align: center; font-size: 13px; color: var(--muted); }
.footer-links .link { color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- sheet & toast ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0; background: var(--bg-2);
  border-top: 1px solid rgba(255, 63, 191, 0.45);
  box-shadow: 0 -10px 50px rgba(255, 31, 166, 0.25);
  animation: up .2s ease-out;
}
.sheet .grip { width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.15); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 16px; font-family: var(--font-display); font-size: 18px; font-weight: 700; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px;
  background: #22132f; border: 1px solid var(--red); box-shadow: var(--glow);
  font-size: 14px; font-weight: 600; transition: all .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.loader { display: grid; place-items: center; min-height: 70vh; }
.loader div {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid rgba(255, 63, 191, 0.15); border-top-color: var(--red);
  box-shadow: var(--glow); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.mt { margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.logo-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* login background art */
.login-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("logo.jpg") center 20% / cover no-repeat;
  opacity: 0.6; filter: saturate(1.3) blur(3px);
  transform: scale(1.2);
}
.login-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 25%, transparent 0%, rgba(11, 6, 18, 0.55) 55%),
    linear-gradient(to bottom, rgba(11, 6, 18, 0.15) 0%, rgba(11, 6, 18, 0.7) 45%, var(--bg) 78%);
}
.login { position: relative; z-index: 1; }
.login .logo.big .logo-mark { width: 104px; height: 104px; border-radius: 30px; border: 2px solid rgba(255, 120, 220, 0.8); }
.login .pin .cell:not(.filled) { background: rgba(18, 10, 28, 0.72); border-color: rgba(255, 120, 220, 0.25); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.login p { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); color: #d9c8e6; }
.login .keypad button { background: rgba(26, 16, 38, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* request progress bar */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  background: linear-gradient(90deg, transparent, #ff3fbf, #e02bff, transparent);
  background-size: 50% 100%; background-repeat: no-repeat;
  box-shadow: 0 0 12px rgba(255, 63, 191, 0.8);
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
body.busy::before { opacity: 1; animation: progress .9s linear infinite; }
@keyframes progress { from { background-position: -100% 0; } to { background-position: 200% 0; } }
