* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0e0e12;
  color: #fff;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.app { max-width: 480px; margin: 0 auto; padding-bottom: 20px; min-height: 100vh; }

/* HEADER */
.topbar { position: sticky; top: 0; z-index: 5; background: #0e0e12; padding: 10px 12px 6px; }

.search-row { display: flex; gap: 8px; align-items: center; }

.search-box {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: #1b1b20; border: 1px solid #2a2a31; border-radius: 14px;
  padding: 10px 12px; color: #8b8b96;
}
.search-box input {
  background: transparent; border: none; outline: none; color: #fff;
  width: 100%; font-size: 15px;
}
.search-box input::placeholder { color: #6f6f7a; }

.sort-btn {
  display: flex; align-items: center; gap: 6px;
  background: #1b1b20; border: 1px solid #4d6bff; border-radius: 14px;
  color: #7fa0ff; padding: 10px 12px; font-size: 14px; white-space: nowrap;
}

/* KATEGORIYA TABLARI (Gift / Username) */
.cat-tabs { display: flex; gap: 8px; margin-top: 10px; }
.cat-tab {
  flex: 1; background: #1b1b20; border: 1px solid #2a2a31; border-radius: 12px;
  color: #9a9aa4; padding: 9px 10px; font-size: 13px; font-weight: 600;
}
.cat-tab.active { background: #2c6bff; border-color: #2c6bff; color: #fff; }

/* HAMYON ULASH QATORI */
.wallet-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.wallet-label { color: #8b8b96; font-size: 12px; }

.filter-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: #9a9aa4; font-size: 13px; }
.chip-btn { background: none; border: none; color: #cfcfd6; font-size: 14px; }
.result-count { flex: 1; }
.view-toggle { display: flex; gap: 4px; background: #1b1b20; border-radius: 10px; padding: 2px; }
.view-btn { background: transparent; border: none; color: #8b8b96; padding: 4px 8px; border-radius: 8px; }
.view-btn.active { background: #2c6bff; color: #fff; }

/* LIST */
.list { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }

.card {
  display: flex; align-items: center; gap: 12px;
  background: #17171c; border: 1px solid #232329; border-radius: 16px;
  padding: 10px;
}
.card-icon {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: #2a2a2e;
}
.card-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }

.card-body { flex: 1; min-width: 0; }
.card-title { font-weight: 600; font-size: 15px; }
.card-title .num { color: #8b8b96; font-weight: 400; }
.card-price { color: #4d9bff; font-weight: 700; margin-top: 2px; font-size: 14px; }
.card-price .unit { color: #8b8b96; font-weight: 400; }

.card-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.duration { display: flex; align-items: center; gap: 3px; color: #9a9aa4; font-size: 12px; }
.tag { border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.tag.model { background: #4a1d33; color: #ef83bb; }
.tag.symbol { background: #2a2450; color: #b09bff; }

.rent-btn {
  background: linear-gradient(135deg, #8a5cff, #3d7bff);
  color: #fff; border: none; border-radius: 999px;
  padding: 9px 18px; font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.rent-btn:active { opacity: .8; }

.loader, .empty { text-align: center; color: #8b8b96; padding: 30px; }
.hidden { display: none !important; }

/* SORT SHEET */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; }
.sheet-inner {
  max-width: 480px; margin: 0 auto; background: #1e1e24;
  border-radius: 16px 16px 0 0; overflow: hidden;
}
.sheet-option {
  display: block; width: 100%; text-align: left; background: #2c2c33;
  border-bottom: 1px solid #38383f; color: #fff; padding: 16px 20px; font-size: 16px;
}
.sheet-option:last-child { border-bottom: none; }
.sheet-option.active { color: #4d9bff; }

/* AVTO TO'LOV TOGGLE */
.autopay-toggle {
  display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: #cfcfd6;
  margin: 10px 0 4px; cursor: pointer;
}
.autopay-toggle input { margin-top: 2px; flex-shrink: 0; }
.autopay-warning {
  font-size: 11px; color: #e0a63b; background: #2a2110; border: 1px solid #4a3a17;
  border-radius: 8px; padding: 7px 10px; margin-bottom: 4px; line-height: 1.4;
}

/* MODAL */
.modal { background: #1e1e24; border-radius: 16px; padding: 20px; width: 88%; max-width: 360px; }
.step-badge {
  display: inline-block; background: #2a2450; color: #b09bff; font-size: 11px;
  font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.step-badge-2 { background: #1a3a2e; color: #4ade80; }
.modal h3 { margin-bottom: 10px; }
.modal p { color: #b3b3bb; font-size: 14px; margin-bottom: 14px; line-height: 1.4; }
.duration-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.duration-row label { color: #9a9aa4; font-size: 13px; }
.duration-row input {
  background: #2c2c33; border: 1px solid #3a3a42; border-radius: 10px;
  color: #fff; padding: 9px 12px; font-size: 15px;
}
.modal-status { min-height: 18px; font-size: 13px; color: #7fa0ff; margin-bottom: 8px; }
.modal-status.error { color: #ff8080; }
.modal-actions { display: flex; gap: 10px; }
.btn-secondary, .btn-primary { flex: 1; border: none; border-radius: 12px; padding: 11px; font-weight: 600; }
.btn-secondary { background: #2c2c33; color: #cfcfd6; }
.btn-primary { background: linear-gradient(135deg, #8a5cff, #3d7bff); color: #fff; }

/* FRAGMENTGA ULASH (to'lovdan keyin ko'rinadigan qism) */
.fragment-connect { margin-top: 14px; padding-top: 14px; border-top: 1px solid #2a2a31; }
.fc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.fc-icon {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #8a5cff, #3d7bff);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.fc-title { color: #fff; font-weight: 700; font-size: 15px; }
.fc-subtitle { color: #8b8b96; font-size: 12px; margin-top: 1px; }
.fc-steps { list-style: none; counter-reset: fc; background: #17171c; border: 1px solid #232329;
  border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.fc-steps li {
  counter-increment: fc; color: #cfcfd6; font-size: 13px; line-height: 1.5; position: relative;
  padding-left: 22px; margin-bottom: 8px;
}
.fc-steps li:last-child { margin-bottom: 0; }
.fc-steps li::before {
  content: counter(fc) "."; position: absolute; left: 0; color: #7fa0ff; font-weight: 700;
}
.fc-steps a { color: #7fa0ff; text-decoration: underline; }
.fc-input-row { display: flex; gap: 8px; margin-bottom: 10px; }
.fc-input-row input {
  flex: 1; background: #2c2c33; border: 1px solid #3a3a42; border-radius: 10px;
  color: #fff; padding: 9px 12px; font-size: 13px; min-width: 0;
}
.fc-paste-btn {
  flex-shrink: 0; width: 40px; background: #2c2c33; border: 1px solid #3a3a42;
  border-radius: 10px; font-size: 16px; color: #cfcfd6;
}
.fc-success { text-align: center; padding-top: 6px; }
.fc-success-check {
  width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 10px;
  background: #1f3a2a; color: #4ade80; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.fc-success-title { color: #fff; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.fc-success-hint { color: #8b8b96; font-size: 12px; margin-bottom: 14px; line-height: 1.4; }
.fc-assets-btn { display: block; text-align: center; text-decoration: none; }

/* AVATAR (username kartalari uchun) — rangli doira ichida bosh harf */
.card-icon.avatar { border-radius: 50%; font-weight: 700; font-size: 22px; color: #fff; }
.card-icon.avatar img { border-radius: 50%; }
