:root {
  color-scheme: dark;
  --bg: #09121e;
  --panel: #0f1d2f;
  --panel-2: #13253b;
  --muted: #7f92ab;
  --line: rgba(255,255,255,.08);
  --text: #f3f7fc;
  --accent: #4dd37d;
  --accent-2: #1fb6ff;
  --danger: #ff6b6b;
  --warning: #ffbe55;
  --shadow: 0 18px 50px rgba(0,0,0,.28);
  --radius: 18px;
  --radius-sm: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.app-shell { max-width: 1120px; margin: 0 auto; min-height: 100vh; padding: 16px 16px 100px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.topbar h1 { margin: 4px 0 0; font-size: 28px; line-height: 1.1; }
.page-subtitle { margin: 6px 0 0; color: var(--muted); }
.icon-btn, .btn, .btn-ghost, .btn-danger, .btn-secondary { border: 0; border-radius: 14px; transition: .18s ease; }
.icon-btn { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; background: var(--panel); color: var(--text); box-shadow: var(--shadow); font-size: 22px; }
.icon-btn:hover { transform: translateY(-1px); }
.content { display: grid; gap: 14px; }
.card, .loading-card, .panel { background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)), var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card, .panel { padding: 16px; }
.loading-card { padding: 28px 22px; text-align: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(255,255,255,.14); border-top-color: var(--accent); margin: 0 auto 12px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bottom-nav { position: fixed; z-index: 40; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); display: grid; gap: 8px; grid-template-columns: repeat(5, 1fr); padding: 8px; border-radius: 22px; background: rgba(10, 18, 30, .92); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 24px 60px rgba(0,0,0,.35); backdrop-filter: blur(14px); }
.nav-item { background: transparent; color: var(--muted); border: 0; border-radius: 16px; display: flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; min-height: 62px; }
.nav-item b { font-size: 11px; font-weight: 700; }
.nav-icon { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 22px; height: 22px; fill: currentColor; }
.nav-item.active { background: linear-gradient(180deg, rgba(77,211,125,.18), rgba(77,211,125,.06)); color: var(--text); }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.inline-scroll { display: flex; gap: 10px; overflow: auto; padding-bottom: 4px; }
.inline-scroll::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 9px 12px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.chip.active { border-color: rgba(77,211,125,.65); box-shadow: inset 0 0 0 1px rgba(77,211,125,.4); }
.chip small { color: var(--muted); }
.section-title { margin: 0; font-size: 18px; }
.section-subtitle { margin: 4px 0 0; color: var(--muted); }
.product-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.product-card { background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015)); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.product-card .visual { aspect-ratio: 16 / 9; background: radial-gradient(circle at top right, rgba(77,211,125,.14), transparent 35%), linear-gradient(180deg, #13253b, #0c1625); display: flex; align-items: center; justify-content: center; padding: 0; }
.product-card .visual > .media-frame, .hero-image > .media-frame { width: 100%; height: 100%; }
.product-card .visual img, .hero-image img, .category-thumb img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }
.product-card .body { padding: 14px; display: grid; gap: 8px; }
.product-card h3 { margin: 0; font-size: 19px; line-height: 1.2; }
.product-card p { margin: 0; color: var(--muted); font-size: 13px; }
.price-line { font-weight: 800; font-size: 20px; color: #8cc8ff; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: rgba(255,255,255,.06); padding: 6px 10px; font-size: 12px; }
.badge.ok { background: rgba(77,211,125,.15); color: #b9f5c9; }
.badge.warn { background: rgba(255,190,85,.18); color: #ffe5b1; }
.badge.danger { background: rgba(255,107,107,.15); color: #ffc0c0; }
.hero-image { aspect-ratio: 16 / 9; background: linear-gradient(180deg, #152741, #0d1828); border-radius: 18px; overflow: hidden; padding: 0; display: flex; align-items: center; justify-content: center; }
.detail-copy { display: grid; gap: 10px; }
.detail-copy h2 { margin: 0; font-size: 24px; }
.detail-copy p { margin: 0; color: var(--muted); }
.qty-picker { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 6px; }
.qty-picker button { width: 34px; height: 34px; border-radius: 999px; border: 0; background: var(--panel-2); color: var(--text); }
.qty-picker b { min-width: 24px; text-align: center; }
.method-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.method-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-align: left; }
.method-card strong { display: block; }
.method-card small { color: var(--muted); }
.btn, .btn-secondary, .btn-ghost, .btn-danger { padding: 12px 14px; }
.btn { background: linear-gradient(180deg, #57df88, #2ebb67); color: #06110a; font-weight: 800; }
.btn:hover { filter: brightness(1.02); transform: translateY(-1px); }
.btn-secondary { background: linear-gradient(180deg, #2b9fff, #177dde); color: white; font-weight: 700; }
.btn-ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: rgba(255,107,107,.15); color: #ffc5c5; border: 1px solid rgba(255,107,107,.22); }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label.field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 14px; padding: 12px 14px; }
.field textarea { min-height: 120px; resize: vertical; }
.field small { color: var(--muted); }
.topup-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.value-card { padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(31,182,255,.18), rgba(77,211,125,.06)); }
.value-card b { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.value-card strong { display: block; margin-top: 8px; font-size: 30px; }
.order-list, .simple-list { display: grid; gap: 12px; }
.order-card, .simple-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--panel-2); }
.order-card h4, .simple-card h4 { margin: 0 0 8px; font-size: 17px; }
.order-card p, .simple-card p { margin: 0; color: var(--muted); }
.order-card pre { margin: 12px 0 0; white-space: pre-wrap; word-break: break-word; background: rgba(0,0,0,.2); padding: 12px; border-radius: 12px; }
.empty { padding: 22px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: 18px; }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; background: rgba(7,12,18,.96); color: var(--text); border-radius: 16px; border: 1px solid var(--line); padding: 12px 16px; box-shadow: var(--shadow); min-width: 280px; max-width: min(92vw, 560px); }
.modal { position: fixed; inset: 0; z-index: 80; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.modal-sheet { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(960px, calc(100vw - 20px)); max-height: calc(100vh - 24px); overflow: auto; background: #0b1522; border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 18px; }
.modal-close { position: sticky; top: 0; margin-left: auto; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 999px; background: rgba(255,255,255,.06); color: white; }
.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpi { background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.kpi b { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.kpi strong { display: block; font-size: 28px; margin-top: 8px; }
.admin-tabs { display: flex; gap: 10px; overflow: auto; padding-bottom: 4px; }
.admin-tabs .tab { white-space: nowrap; }
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 12px 10px; text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.thumb { width: 112px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, #13253b, #0d1828); display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); }
.thumb > .media-frame { width: 100%; height: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }

/* Images are always fitted inside their frame. The blurred layer fills empty side areas without cropping the source. */
.media-frame, .media-empty { position: relative; overflow: hidden; width: 100%; height: 100%; min-height: 80px; background: linear-gradient(180deg, #152741, #0d1828); }
.media-frame { display: grid; place-items: center; isolation: isolate; }
.media-blur { position: absolute; inset: -18px; z-index: 0; background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(22px) brightness(.42) saturate(.9); transform: scale(1.08); opacity: .82; }
.media-frame::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(5,10,18,.08), rgba(5,10,18,.26)); }
.media-frame img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain !important; object-position: center !important; display: block; }
.media-empty { display: grid; place-items: center; color: var(--muted); padding: 18px; text-align: center; }
.product-media, .hero-media, .thumb-media, .screen-media, .upload-media { aspect-ratio: 16 / 9; }
.interface-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.screen-preview { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; aspect-ratio: 16 / 9; }
.screen-preview > .media-frame, .screen-preview > .media-empty { height: 100%; }
.button-icon-row { display: grid; grid-template-columns: minmax(190px, 1.5fr) minmax(220px, 1fr) auto auto; align-items: end; gap: 12px; }
.button-icon-copy { display: grid; gap: 5px; align-self: center; }
.field.compact { min-width: 0; }
.switch-line { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--text); white-space: nowrap; }
.switch-line input, .setting-toggle input { width: 22px; height: 22px; accent-color: var(--accent); flex: 0 0 auto; }
.setting-toggle { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.setting-toggle > span { display: grid; gap: 4px; }
.setting-toggle small { color: var(--muted); }
.status-word { font-size: 19px !important; }
.status-ok { color: #b9f5c9; }
.status-off { color: #ffc0c0; }
.break-all { overflow-wrap: anywhere; word-break: break-word; }
.upload-preview { overflow: hidden; border-radius: 16px; border: 1px solid var(--line); aspect-ratio: 16 / 9; background: var(--panel-2); }
.upload-preview > .media-frame, .upload-preview > .media-empty { height: 100%; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.monospace { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.note { color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  .grid.cols-3, .grid.cols-2, .form-grid.two { grid-template-columns: 1fr; }
  .button-icon-row { grid-template-columns: 1fr 1fr; align-items: center; }
  .modal-sheet { padding: 16px; width: min(100vw - 12px, 960px); }
}
@media (max-width: 640px) {
  .app-shell { padding: 14px 14px 104px; }
  .topbar h1 { font-size: 24px; }
  .bottom-nav { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .nav-item b { font-size: 10px; }
  .product-grid { grid-template-columns: 1fr; }
  .method-grid, .topup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .button-icon-row { grid-template-columns: 1fr; align-items: stretch; }
  .interface-grid { grid-template-columns: 1fr; }
  .setting-toggle { align-items: flex-start; }
  .thumb { width: 96px; }
}

/* Compact mobile layout for Telegram Mini App. */
@media (max-width: 700px) {
  html, body { font-size: 13px; line-height: 1.32; }
  .app-shell { padding: 8px 8px 72px; }
  .topbar { align-items: center; gap: 8px; margin-bottom: 8px; }
  .eyebrow, .page-subtitle { display: none; }
  .topbar h1 { margin: 0; font-size: 19px; line-height: 1.1; }
  .icon-btn { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; box-shadow: none; }
  .content, .grid, .stack, .form-grid, .order-list, .simple-list { gap: 8px; }
  .card, .panel { padding: 10px; border-radius: 12px; box-shadow: none; }
  .loading-card { padding: 18px 12px; border-radius: 12px; box-shadow: none; }
  .spinner { width: 26px; height: 26px; border-width: 3px; margin-bottom: 8px; }

  .bottom-nav {
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    bottom: max(6px, env(safe-area-inset-bottom));
    gap: 2px;
    padding: 4px;
    border-radius: 14px;
  }
  .nav-item { min-height: 46px; gap: 1px; border-radius: 10px; padding: 3px 1px; }
  .nav-icon { width: 18px; height: 18px; }
  .nav-icon svg { width: 18px; height: 18px; }
  .nav-item b { font-size: 9px; line-height: 1.05; }

  .row { gap: 7px; }
  .inline-scroll { gap: 6px; padding-bottom: 1px; }
  .chip { padding: 6px 8px; gap: 5px; font-size: 12px; }
  .section-title { font-size: 15px; }
  .section-subtitle { margin-top: 2px; font-size: 11px; line-height: 1.25; }
  .note { font-size: 11px; line-height: 1.28; }

  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-card { border-radius: 12px; }
  .product-card .body { padding: 8px; gap: 5px; }
  .product-card h3 {
    font-size: 14px;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 32px;
  }
  .product-card p { display: none; }
  .price-line { font-size: 15px; line-height: 1.15; }
  .meta { gap: 4px; }
  .badge { padding: 4px 6px; gap: 3px; font-size: 10px; }
  .product-card .meta .badge:nth-child(2) { display: none; }

  .btn, .btn-secondary, .btn-ghost, .btn-danger {
    padding: 8px 9px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.15;
  }
  .actions { gap: 5px; }

  .hero-image { border-radius: 12px; }
  .detail-copy { gap: 7px; }
  .detail-copy h2 { font-size: 19px; }
  .qty-picker { gap: 6px; padding: 4px; }
  .qty-picker button { width: 30px; height: 30px; }
  .method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .method-card { padding: 9px; border-radius: 10px; }

  .field input, .field textarea, .field select { border-radius: 9px; padding: 9px 10px; }
  .field textarea { min-height: 80px; }
  label.field { gap: 4px; font-size: 12px; }
  .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .value-card, .order-card, .simple-card, .kpi { padding: 9px; border-radius: 11px; }
  .value-card strong { margin-top: 4px; font-size: 23px; }
  .order-card h4, .simple-card h4 { margin-bottom: 4px; font-size: 14px; }
  .order-card pre { margin-top: 7px; padding: 8px; border-radius: 8px; }
  .empty { padding: 14px 10px; border-radius: 11px; }

  .modal-sheet {
    left: 6px;
    right: 6px;
    top: auto;
    bottom: max(6px, env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    max-height: calc(100vh - 12px);
    padding: 10px;
    border-radius: 16px 16px 10px 10px;
  }
  .modal-close { width: 32px; height: 32px; }

  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .kpi strong { margin-top: 4px; font-size: 20px; }
  .status-word { font-size: 14px !important; }
  .admin-tabs { gap: 5px; margin: 0 -2px; }
  .table th, .table td { padding: 7px 6px; font-size: 11px; }
  .thumb { width: 64px; border-radius: 8px; }

  .interface-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .interface-grid .simple-card { gap: 6px; }
  .interface-grid .actions { display: grid; grid-template-columns: 1fr; }
  .screen-preview { border-radius: 9px; }
  .button-icon-row { grid-template-columns: 1fr auto; gap: 7px; padding: 9px; }
  .button-icon-copy .note { display: none; }
  .button-icon-row .field { grid-column: 1 / -1; }
  .button-icon-row .switch-line { min-height: 32px; font-size: 11px; }
  .button-icon-row > .btn-secondary { align-self: center; }
  .switch-line input, .setting-toggle input { width: 18px; height: 18px; }

  .setting-toggle { gap: 8px; padding: 9px; border-radius: 11px; align-items: center; }
  .setting-toggle > span { gap: 1px; }
  .setting-toggle small { font-size: 10px; line-height: 1.2; }
  .upload-preview { border-radius: 10px; }
  .hr { margin: 10px 0; }
  .toast { top: 8px; min-width: 0; width: calc(100vw - 16px); padding: 9px 11px; border-radius: 10px; }
}

@media (max-width: 360px) {
  .app-shell { padding-left: 6px; padding-right: 6px; }
  .product-grid { gap: 6px; }
  .product-card .body { padding: 7px; }
  .product-card h3 { font-size: 13px; }
  .price-line { font-size: 14px; }
  .btn, .btn-secondary, .btn-ghost, .btn-danger { padding: 7px 7px; font-size: 11px; }
  .nav-item b { font-size: 8px; }
}

/* --------------------------------------------------------------------------
   VexzyMarket UI refresh: natural banners, clear hierarchy, compact mobile UI
   -------------------------------------------------------------------------- */
:root {
  --bg: #07111d;
  --panel: #0d1a2a;
  --panel-2: #122238;
  --panel-3: #172b45;
  --muted: #8fa3bb;
  --line: rgba(154, 181, 212, .13);
  --line-strong: rgba(154, 181, 212, .22);
  --text: #f5f8fc;
  --accent: #55d98a;
  --accent-strong: #2fbd6a;
  --accent-soft: rgba(85, 217, 138, .12);
  --accent-2: #54a9ff;
  --danger: #ff7676;
  --warning: #ffc362;
  --shadow: 0 14px 36px rgba(0, 0, 0, .22);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .14);
  --radius: 18px;
  --radius-sm: 13px;
}

html, body {
  background:
    radial-gradient(circle at 80% -10%, rgba(84, 169, 255, .08), transparent 34%),
    radial-gradient(circle at 10% 0%, rgba(85, 217, 138, .06), transparent 28%),
    var(--bg);
}
body { min-height: 100vh; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid rgba(84, 169, 255, .7);
  outline-offset: 2px;
}

.app-shell { max-width: 900px; padding: 14px 14px 96px; }
.topbar { align-items: center; margin-bottom: 14px; }
.topbar h1 { font-size: 25px; letter-spacing: -.02em; }
.icon-btn { box-shadow: var(--shadow-soft); border: 1px solid var(--line); }
.content { gap: 12px; }

.card, .panel, .loading-card {
  background: linear-gradient(180deg, rgba(255,255,255,.018), transparent 38%), var(--panel);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}
.card, .panel { padding: 15px; }
.stack { gap: 11px; }
.section-title { font-size: 17px; letter-spacing: -.01em; }
.section-subtitle { line-height: 1.38; }

/* Natural image proportions: never crop or force 16:9. */
.media-frame {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  background: transparent;
  isolation: auto;
}
.media-frame::after, .media-blur { display: none !important; }
.media-frame img {
  position: static;
  display: block;
  width: 100%;
  height: auto !important;
  max-height: none;
  object-fit: contain !important;
  object-position: center;
}
.product-media, .hero-media, .screen-media, .upload-media { aspect-ratio: auto !important; }
.product-card .visual,
.hero-image,
.screen-preview,
.upload-preview {
  aspect-ratio: auto !important;
  height: auto;
  min-height: 0;
}
.product-card .visual > .media-frame,
.hero-image > .media-frame,
.screen-preview > .media-frame,
.upload-preview > .media-frame { height: auto; }
.product-card .visual img,
.hero-image img,
.screen-preview img,
.upload-preview img { height: auto !important; }
.media-empty { min-height: 104px; }

/* Only tiny admin thumbnails keep a fixed frame. */
.thumb { aspect-ratio: 16 / 9; }
.thumb .media-frame, .thumb .media-empty { height: 100%; }
.thumb .media-frame img { width: 100%; height: 100% !important; object-fit: contain !important; }

.product-grid { gap: 11px; align-items: start; }
.product-card {
  align-self: start;
  background: var(--panel);
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: 0 7px 20px rgba(0,0,0,.12);
}
.product-card .visual {
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #091522;
}
.product-card .body { padding: 12px; gap: 7px; }
.product-card h3 { font-size: 17px; }
.price-line { color: #8dc5ff; font-size: 18px; }
.badge { border: 1px solid rgba(255,255,255,.035); }

.btn, .btn-secondary, .btn-ghost, .btn-danger {
  min-height: 43px;
  padding: 10px 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}
.btn { background: linear-gradient(180deg, #60e594, #37c675); box-shadow: 0 8px 18px rgba(47,189,106,.18); }
.btn-secondary { background: linear-gradient(180deg, #3c9cf2, #237fd6); box-shadow: 0 8px 18px rgba(35,127,214,.15); }
.btn-ghost { background: rgba(255,255,255,.035); border-color: var(--line-strong); }
.btn-ghost:hover, .method-card:hover { background: rgba(255,255,255,.055); }
.actions { gap: 7px; }

.field { min-width: 0; }
.field > span { color: #b8c6d7; font-weight: 650; }
.field input, .field textarea, .field select {
  min-height: 46px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #0a1727;
  border-color: var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.018);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: rgba(84,169,255,.65);
  box-shadow: 0 0 0 3px rgba(84,169,255,.10);
  background: #0c1b2d;
}

/* Numbered section headings keep forms easy to scan. */
.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.section-heading > div { min-width: 0; }
.step-badge {
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(85,217,138,.25);
  color: #aef0c4;
  font-weight: 850;
  font-size: 13px;
}
.section-divider { height: 1px; background: var(--line); margin: 2px 0; }
.helper-note {
  margin: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(84,169,255,.14);
  background: rgba(84,169,255,.07);
  color: #aebed0;
  font-size: 12px;
  line-height: 1.4;
}

/* Balance and top-up page. */
.balance-page { display: grid; gap: 12px; }
.balance-card {
  position: relative;
  overflow: hidden;
  padding: 17px;
  background:
    radial-gradient(circle at 100% 0, rgba(84,169,255,.22), transparent 40%),
    linear-gradient(135deg, rgba(85,217,138,.12), rgba(84,169,255,.08)),
    var(--panel);
}
.balance-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -55px;
  bottom: -76px;
  border: 22px solid rgba(255,255,255,.025);
  border-radius: 50%;
}
.balance-card__label { color: #aebed0; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.balance-card strong { margin-top: 5px; font-size: 29px; letter-spacing: -.03em; }
.balance-card__hint { margin-top: 5px; color: var(--muted); font-size: 12px; }
.topup-card { display: grid; gap: 13px; }
.amount-field { gap: 7px !important; }
.amount-input-wrap { position: relative; }
.amount-input-wrap input {
  padding-right: 66px;
  min-height: 54px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.amount-input-wrap b {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #8fa3bb;
  font-size: 12px;
  letter-spacing: .04em;
}
.policy-card { padding: 0; overflow: hidden; }
.policy-card summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 15px;
  font-weight: 750;
  color: #c8d4e1;
}
.policy-card summary::-webkit-details-marker { display: none; }
.policy-card summary::after { content: "+"; float: right; color: var(--muted); font-size: 18px; line-height: 1; }
.policy-card[open] summary::after { content: "−"; }
.policy-copy { padding: 0 15px 14px; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--line); padding-top: 12px; }

/* Payment method selector: clear cards, not a wall of text. */
.method-grid, .topup-grid { gap: 8px; }
.method-card {
  width: 100%;
  min-height: 62px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: #0b1929;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.method-card:active { transform: scale(.985); }
.method-card:hover { border-color: rgba(84,169,255,.35); }
.method-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(84,169,255,.15), rgba(85,217,138,.10));
  border: 1px solid rgba(84,169,255,.18);
  color: #a9d4ff;
  font-size: 15px;
  font-weight: 850;
}
.method-copy { min-width: 0; display: grid; gap: 3px; }
.method-copy strong { font-size: 13px; line-height: 1.2; overflow-wrap: anywhere; }
.method-copy small { color: var(--muted); font-size: 11px; }
.method-arrow { color: #668099; font-size: 22px; line-height: 1; }
.checkout-section {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.017);
}

/* Payment/top-up result modals. */
.payment-flow { display: grid; gap: 12px; }
.payment-title { display: flex; align-items: flex-start; gap: 11px; padding-right: 36px; }
.payment-title__icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid rgba(85,217,138,.23);
  color: #adf0c3;
  font-size: 18px;
  font-weight: 900;
}
.payment-title h2 { margin: 1px 0 3px; font-size: 20px; line-height: 1.2; }
.payment-title p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.payment-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(210px, .75fr); gap: 10px; }
.payment-summary, .payment-actions, .txid-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}
.payment-summary { padding: 5px 12px; }
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}
.summary-row:last-of-type { border-bottom: 0; }
.summary-row span { color: var(--muted); font-size: 12px; }
.summary-row strong { text-align: right; overflow-wrap: anywhere; }
.summary-row--amount strong { color: #91c9ff; font-size: 17px; }
.payment-address {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  padding: 10px;
  background: #081421;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.payment-address > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.payment-address code { color: #dbe8f5; overflow-wrap: anywhere; word-break: break-all; line-height: 1.45; }
.payment-summary .helper-note { margin: 8px 0; }
.payment-actions { padding: 10px; display: grid; gap: 7px; align-content: start; }
.payment-actions .btn, .payment-actions .btn-secondary, .payment-actions .btn-ghost { width: 100%; }
.payment-primary { min-height: 47px; }
.txid-card { padding: 12px; display: grid; gap: 10px; }
.delivered-card { border-color: rgba(85,217,138,.22); }

.modal-sheet { background: #091522; border-color: var(--line-strong); }
.modal-close { z-index: 3; border: 1px solid var(--line); }

/* Better mobile fit without making everything tiny. */
@media (max-width: 700px) {
  html, body { font-size: 13px; line-height: 1.38; }
  .app-shell { padding: 9px 9px 72px; }
  .topbar { margin-bottom: 9px; }
  .topbar h1 { font-size: 20px; }
  .card, .panel { padding: 11px; border-radius: 14px; }
  .content, .stack, .grid, .form-grid, .order-list, .simple-list { gap: 9px; }

  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-card { border-radius: 13px; }
  .product-card .body { padding: 9px; gap: 6px; }
  .product-card h3 { min-height: 31px; font-size: 13px; }
  .product-card .btn { min-height: 37px; }
  .price-line { font-size: 14px; }

  .btn, .btn-secondary, .btn-ghost, .btn-danger { min-height: 41px; padding: 9px 11px; font-size: 12px; border-radius: 11px; }
  .field input, .field textarea, .field select { min-height: 44px; padding: 10px 11px; border-radius: 11px; }
  .amount-input-wrap input { min-height: 52px; font-size: 21px; padding-right: 62px; }

  .section-heading { gap: 9px; }
  .step-badge { flex-basis: 27px; width: 27px; height: 27px; border-radius: 9px; }
  .section-title { font-size: 15px; }
  .section-subtitle { font-size: 11px; }
  .balance-page { gap: 9px; }
  .balance-card { padding: 14px; }
  .balance-card strong { font-size: 26px; }
  .topup-card { gap: 11px; }

  .method-grid, .topup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .method-card { min-height: 58px; grid-template-columns: 34px minmax(0,1fr) 14px; gap: 8px; padding: 8px; border-radius: 11px; }
  .method-icon { width: 34px; height: 34px; border-radius: 10px; }
  .method-copy strong { font-size: 12px; }
  .method-copy small { font-size: 10px; }
  .method-arrow { font-size: 18px; }
  .checkout-section { padding: 10px; border-radius: 13px; }

  .modal-sheet { padding: 10px; }
  .payment-title { gap: 9px; }
  .payment-title__icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; }
  .payment-title h2 { font-size: 17px; }
  .payment-layout { grid-template-columns: 1fr; gap: 8px; }
  .payment-summary, .payment-actions, .txid-card { border-radius: 12px; }
  .summary-row { min-height: 39px; }
  .payment-actions { grid-template-columns: 1fr 1fr; }
  .payment-actions > :first-child:last-child { grid-column: 1 / -1; }
  .payment-actions .payment-primary { grid-column: 1 / -1; }

  .hero-image, .screen-preview, .upload-preview { border-radius: 12px; }
  .interface-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

@media (max-width: 390px) {
  .method-grid, .topup-grid { grid-template-columns: 1fr; }
  .payment-actions { grid-template-columns: 1fr; }
  .payment-actions .payment-primary { grid-column: auto; }
  .product-card .body { padding: 8px; }
}
