/* ============================================================
   Nidam Super  Mobile-First Design System
   ============================================================ */

:root {
    --blue:        #1E5AA8;
    --blue-dark:   #164680;
    --blue-light:  #E8F0FA;
    --green:       #2EAF5A;
    --green-dark:  #238A47;
    --green-light: #E6F7EC;
    --gold:        #F5A623;
    --gold-dark:   #D4890A;
    --gold-light:  #FEF3DC;

    --bg:          #F8F9FA;
    --surface:     #FFFFFF;
    --text:        #1A1A2E;
    --text-muted:  #6B7280;
    --border:      #E5E7EB;

    --radius-sm:   8px;
    --radius:      12px;
    --radius-lg:   20px;
    --radius-xl:   28px;

    --shadow-sm:   0 1px 3px rgba(0,0,0,.06);
    --shadow:      0 4px 16px rgba(30,90,168,.08);
    --shadow-lg:   0 8px 32px rgba(30,90,168,.12);

    --bottom-nav-h: 64px;
    --touch-min:   48px;

    --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-brand:  'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition:  0.2s ease;

    --wallet-gradient: linear-gradient(145deg, var(--blue) 0%, #2563B8 50%, var(--green) 100%);
    --hub-gradient: linear-gradient(145deg, #164680 0%, var(--blue) 42%, var(--green) 100%);
    --hub-shell-gradient: linear-gradient(135deg, var(--blue) 0%, var(--green) 65%, var(--gold) 100%);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y pinch-zoom;
    -webkit-font-smoothing: antialiased;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.app-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    background: var(--bg);
    position: relative;
    overflow-x: clip;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

body:not(.app-ready) .app-main,
body:not(.app-ready) .bottom-nav {
    visibility: hidden;
}

body.auth-mode .bottom-nav {
    display: none;
}

body.auth-mode .app-main {
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}

body.auth-mode .app-shell {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 15px; }

.container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-xl);
    background: var(--bg);
    border: 1px solid var(--border);
    min-height: var(--touch-min);
    font-size: 13px;
    font-weight: 600;
}

.lang-opt {
    color: var(--text-muted);
    transition: color var(--transition);
}

.lang-opt.active {
    color: var(--blue);
}

.lang-divider {
    color: var(--border);
    font-weight: 300;
}

/* ?? Hero ????????????????????????????????????????????????? */

.hero {
    padding: 32px 0 48px;
    background: linear-gradient(165deg, var(--blue) 0%, #2563B8 40%, var(--green) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--bg);
    border-radius: 24px 24px 0 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .6; transform: scale(1.3); }
}

.hero-title {
    font-size: clamp(28px, 7vw, 44px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-sub {
    font-size: clamp(15px, 3.5vw, 18px);
    line-height: 1.65;
    opacity: .92;
    max-width: 520px;
    margin: 0 auto 28px;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--touch-min);
    padding: 12px 28px;
    border-radius: var(--radius-xl);
    font-size: 15px;
    font-weight: 600;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    width: 100%;
    max-width: 280px;
}

.btn:active {
    transform: scale(.97);
}

.btn-primary {
    background: var(--gold);
    color: #1A1A2E;
    box-shadow: 0 4px 16px rgba(245,166,35,.35);
}

.btn-primary:hover {
    background: var(--gold-dark);
    box-shadow: 0 6px 20px rgba(245,166,35,.45);
}

.btn-outline {
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,.35);
    backdrop-filter: blur(4px);
}

.btn-outline:hover {
    background: rgba(255,255,255,.22);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat-num {
    font-size: 22px;
    font-weight: 800;
    display: block;
}

.hero-stat-label {
    font-size: 12px;
    opacity: .75;
    font-weight: 500;
}

/* ?? Section shared ??????????????????????????????????????? */

.section {
    padding: 48px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--green);
    margin-bottom: 8px;
}

.section-title {
    font-size: clamp(22px, 5vw, 32px);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.section-sub {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto;
}

/* ?? Services Grid ???????????????????????????????????????? */

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.service-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 12px 6px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    min-width: 0;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
}

.service-card:active {
    transform: scale(.97);
}

.service-card.hidden {
    display: none;
}

.service-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.service-icon svg {
    width: 22px;
    height: 22px;
}

.service-icon.food      { background: #FEF3DC; color: #D4890A; }
.service-icon.jobs      { background: var(--blue-light); color: var(--blue); }
.service-icon.sports    { background: #FCE4EC; color: #C62828; }
.service-icon.soko      { background: var(--green-light); color: var(--green-dark); }
.service-icon.logistics { background: #EDE7F6; color: #5E35B1; }
.service-icon.errands   { background: #E0F7FA; color: #00838F; }
.service-icon.bills     { background: #FFF8E1; color: #F9A825; }
.service-icon.miniapps  { background: #F3E5F5; color: #7B1FA2; }

.service-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
    word-break: break-word;
    hyphens: auto;
    width: 100%;
    text-align: center;
}

.service-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    display: none;
}

/* ?? Why / Features ??????????????????????????????????????? */

.features-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.feature-text {
    min-width: 0;
    flex: 1;
}

.feature-text h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.feature-text p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-icon.wallet  { background: var(--blue-light); color: var(--blue); }
.feature-icon.escrow  { background: var(--green-light); color: var(--green-dark); }
.feature-icon.pool    { background: var(--gold-light); color: var(--gold-dark); }
.feature-icon.qr      { background: #EDE7F6; color: #5E35B1; }
.feature-icon.voice   { background: #E0F7FA; color: #00838F; }
.feature-icon.tra     { background: #FFF8E1; color: #F9A825; }

/* ?? For You (Consumer / Merchant) ???????????????????????? */

.audience-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.audience-card {
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.audience-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
}

.audience-card.consumer {
    background: linear-gradient(135deg, var(--blue) 0%, #2563B8 100%);
}

.audience-card.merchant {
    background: linear-gradient(135deg, var(--green) 0%, #34C759 100%);
}

.audience-card h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
}

.audience-card p {
    font-size: 14px;
    opacity: .9;
    line-height: 1.55;
    position: relative;
}

.audience-icon {
    margin-bottom: 12px;
    position: relative;
    color: rgba(255,255,255,.95);
}

.audience-icon svg,
.icon-lg {
    width: 36px;
    height: 36px;
}

.icon-sm {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ?? Waitlist Form ???????????????????????????????????????? */

.join-section {
    background: var(--surface);
    padding-bottom: 24px;
}

.waitlist-form {
    max-width: 480px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-group input,
.form-group select {
    min-height: var(--touch-min);
}

.form-group textarea {
    display: block;
    min-height: 120px;
    line-height: 1.5;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(30,90,168,.12);
}

.form-group input::placeholder {
    color: #A0AEC0;
}

.role-toggle {
    display: flex;
    gap: 10px;
    width: 100%;
}

.role-option {
    flex: 1;
    min-width: 0;
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition);
    cursor: pointer;
}

.role-option.selected {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
}

.role-option input {
    display: none;
}

.form-submit {
    width: 100%;
    margin-top: 8px;
}

.form-message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background: var(--green-light);
    color: var(--green-dark);
    border: 1px solid rgba(46,175,90,.25);
}

.form-message.error {
    display: block;
    background: #FEE2E2;
    color: #B91C1C;
    border: 1px solid rgba(185,28,28,.2);
}

/* ?? Bottom Navigation (app tab bar) ?????????????????????? */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    z-index: 100;
    height: var(--bottom-nav-h);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color var(--transition);
    min-height: var(--touch-min);
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

.bottom-nav-item svg {
    opacity: .6;
    transition: opacity var(--transition);
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--blue);
}

.bottom-nav-item.active svg,
.bottom-nav-item:hover svg {
    opacity: 1;
}

.bottom-nav-cta {
    color: var(--gold-dark);
}

.bottom-nav-cta.active {
    color: var(--gold-dark);
}

/* Tablet (768px+) */

@media (min-width: 768px) {
    .hero {
        padding: 40px 0 56px;
    }

    .hero-actions {
        flex-direction: row;
        justify-content: center;
    }

    .btn {
        width: auto;
    }

    .section {
        padding: 48px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* ============================================================
   App screens (tab navigation)
   ============================================================ */

.app-main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.app-screen {
    display: none;
    animation: screenIn 0.22s ease;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-self: stretch;
    box-sizing: border-box;
    overflow-x: clip;
}

.app-screen.active {
    display: block;
}

body.auth-mode #screen-auth.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}

@keyframes screenIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

body.sheet-open {
    overflow: hidden;
}

/* Home dashboard */
.dash-wallet-wrap {
    padding: 16px 0 8px;
    background: var(--bg);
}

.dash-wallet {
    padding: 20px;
    border-radius: var(--radius-xl);
    background: var(--wallet-gradient);
    color: #fff;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.dash-wallet-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.dash-wallet-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.dash-greeting {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
}

.dash-balance-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.dash-balance-value {
    font-size: clamp(28px, 7vw, 36px);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 16px;
    text-align: center;
}

.dash-wallet-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.dash-topup-btn {
    padding: 10px 20px;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    min-height: 40px;
    width: 100%;
    max-width: 220px;
}

.dash-topup-btn:active {
    transform: scale(0.97);
}

.dash-wallet-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.dash-add-funds-btn {
    background: #fff;
    color: var(--blue);
    border-color: #fff;
}

.dash-order-btn {
    background: rgba(255, 255, 255, 0.15);
}

.dash-active-count {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.85;
}

.home-body {
    padding-top: 12px;
    padding-bottom: 24px;
    width: 100%;
}

.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.dash-card-flush {
    padding-bottom: 12px;
}

.dash-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    text-align: center;
}

.dash-card-head h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    width: 100%;
    text-align: center;
}

.dash-chart-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.dash-chart-total strong {
    color: var(--text);
    font-weight: 700;
}

.dash-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

.dash-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    height: 120px;
    padding: 0 4px;
}

.dash-chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    height: 100%;
}

.dash-bar-track {
    flex: 1;
    width: 100%;
    max-width: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.dash-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, var(--green) 0%, var(--blue) 100%);
    transition: height 0.4s ease;
}

.dash-chart-day {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.dash-svc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-svc-balance {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    min-width: 0;
}

.dash-svc-balance:active {
    transform: scale(0.99);
}

.dash-svc-balance .service-icon {
    width: 40px;
    height: 40px;
}

.dash-svc-balance .service-icon svg {
    width: 20px;
    height: 20px;
}

.dash-svc-info {
    flex: 1;
    min-width: 0;
}

.dash-svc-info strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.dash-svc-amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--green-dark);
    white-space: pre-line;
    line-height: 1.35;
}

[data-theme="dark"] .dash-svc-amount {
    color: var(--green);
}

.dash-empty {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 12px 8px;
    line-height: 1.5;
}

.dash-card-head .link-btn,
.dash-card-head .dash-badge {
    margin-left: auto;
    margin-right: auto;
}

.services-grid,
.home-services-grid {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.me-account-form,
.auth-panel,
.order-list {
    width: 100%;
}

@media (max-width: 767px) {
    .bottom-nav {
        left: 0;
        right: 0;
        margin: 0 auto;
    }

    .dash-wallet-wrap,
    .home-body,
    .screen-body {
        width: 100%;
    }
}

.home-services-grid {
    margin-top: 4px;
}

.link-btn {
    display: inline-block;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 8px 0;
}

.home-actions .btn,
.sheet-content .btn {
    width: 100%;
    max-width: none;
}

.btn-secondary {
    background: var(--surface);
    color: var(--blue);
    border: 1.5px solid var(--blue);
    box-shadow: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    box-shadow: none;
    margin-top: 8px;
}

/* Shared screen layouts */
.screen-top {
    padding: 20px 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.screen-top .container {
    text-align: center;
}

.screen-top .search-bar {
    text-align: left;
}

.screen-top-compact {
    padding-bottom: 12px;
}

.screen-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    text-align: center;
}

.screen-sub {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}

/* Services intro card */
#screen-services .screen-title {
    margin-bottom: 14px;
}

.services-intro {
    margin: 0 auto 4px;
    max-width: 420px;
    text-align: left;
}

.services-intro-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 12px;
    background: linear-gradient(135deg, rgba(30, 90, 168, 0.08) 0%, rgba(46, 175, 90, 0.08) 100%);
    border: 1px solid rgba(30, 90, 168, 0.14);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.services-intro-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--surface);
    color: var(--blue);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.services-intro-icon svg {
    width: 22px;
    height: 22px;
}

.services-intro-body {
    flex: 1;
    min-width: 0;
}

.services-intro-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 4px;
}

.services-intro-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    margin: 0;
}

.services-intro-steps {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 6px;
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.services-intro-steps li {
    flex: 1;
    position: relative;
    min-width: 0;
}

.services-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 4px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    min-height: 100%;
}

.services-step.active,
.services-step:active {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
}

.services-intro-steps li:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-top: 2px solid var(--border);
    border-right: 2px solid var(--border);
    transform: rotate(45deg);
    z-index: 1;
}

.services-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--blue) 0%, var(--green) 100%);
    flex-shrink: 0;
}

.services-step[data-service-step="myhub"] .services-step-num {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
}

.services-step[data-service-step="myhub"].active {
    border-color: var(--gold-dark);
    background: var(--gold-light);
    color: var(--gold-dark);
}

.services-hub-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.services-step-body {
    margin-top: 16px;
}

.services-step-panel {
    display: none;
    animation: servicesStepIn 0.22s ease;
}

.services-step-panel.active {
    display: block;
}

@keyframes servicesStepIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.services-step-card {
    position: relative;
    padding: 18px 18px 18px 52px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.services-step-card-order {
    border-color: rgba(46, 175, 90, 0.2);
    background: linear-gradient(135deg, var(--surface) 0%, var(--green-light) 100%);
}

.services-step-card-num {
    position: absolute;
    left: 16px;
    top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--blue) 0%, var(--green) 100%);
}

.services-step-card-order .services-step-card-num {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
}

.services-step-card-title {
    font-family: var(--font-brand);
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--text);
}

.services-step-card-text,
.services-step-lead {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

.services-step-lead {
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

#servicesMyHubSection.services-step-panel {
    margin-top: 0;
}

#servicesStepSearch .search-results-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.my-hub-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.my-hub-head-simple {
    margin-bottom: 2px;
}

.my-hub-head-simple .services-hub-title {
    font-family: var(--font-brand);
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 4px;
}

.my-hub-head-simple .services-hub-sub {
    margin: 0;
}

.supplier-dashboard {
    position: relative;
    margin-top: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.my-hub-orders-panel {
    margin: 0;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.my-hub-hero {
    margin: 0 0 12px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: var(--blue-light);
    color: var(--text);
    border: 1px solid rgba(30, 90, 168, 0.12);
    box-shadow: none;
}

.my-hub-greeting {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
    opacity: 1;
}

.my-hub-name {
    font-family: var(--font-brand);
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 6px;
}

.my-hub-earned {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

.my-hub-earned strong {
    font-size: 15px;
    font-weight: 800;
    color: var(--green-dark);
}

.my-hub-signin {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.my-hub-signin-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--blue-light);
    color: var(--blue);
}

.my-hub-signin-ring svg {
    width: 28px;
    height: 28px;
}

.my-hub-signin-title {
    font-family: var(--font-brand);
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--text);
}

.my-hub-signin-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0 0 16px;
    max-width: 260px;
}

.my-hub-signin-btn {
    min-width: 180px;
}

.my-hub-empty {
    text-align: center;
    padding: 18px 12px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.supplier-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 0 0 12px;
}

.supplier-stat {
    position: relative;
    padding: 14px 12px 12px 44px;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    text-align: left;
    overflow: hidden;
}

.my-hub-stat-icon {
    position: absolute;
    left: 12px;
    top: 14px;
    width: 22px;
    height: 22px;
    opacity: 0.85;
}

.supplier-stat-listings {
    background: var(--blue-light);
    border-color: rgba(30, 90, 168, 0.12);
    color: var(--blue-dark);
}

.supplier-stat-orders {
    background: var(--green-light);
    border-color: rgba(46, 175, 90, 0.12);
    color: var(--green-dark);
}

.supplier-stat-earned {
    background: var(--gold-light);
    border-color: rgba(245, 166, 35, 0.18);
    color: var(--gold-dark);
}

.supplier-stat-escrow {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.supplier-stat-val {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: inherit;
    margin-bottom: 2px;
    line-height: 1.15;
}

.supplier-stat-lbl {
    font-size: 10px;
    color: inherit;
    opacity: 0.78;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.my-hub-panel {
    margin: 0 0 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.my-hub-panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.my-hub-panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.my-hub-panel-dot-blue {
    background: var(--blue);
    box-shadow: 0 0 0 3px rgba(30, 90, 168, 0.18);
}

.my-hub-panel-dot-green {
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(46, 175, 90, 0.18);
}

.my-hub-panel-dot-gold {
    background: var(--gold);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.2);
}

.my-hub-orders-badge {
    margin-left: auto;
}

.my-hub-panel-count {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: var(--blue);
    background: var(--blue-light);
}

.supplier-subhead {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.supplier-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.supplier-list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
}

.my-hub-listing {
    position: relative;
    padding: 12px 12px 12px 16px;
    border-left: 3px solid var(--blue);
    box-shadow: var(--shadow-sm);
}

.my-hub-listing-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-bottom: 4px;
}

.my-hub-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--blue);
    background: var(--blue-light);
}

.my-hub-listing-title {
    flex: 1 1 100%;
    font-size: 14px;
    line-height: 1.3;
}

.my-hub-listing-price {
    margin-left: auto;
    font-weight: 800;
    font-size: 14px;
    color: var(--green-dark);
}

.supplier-list-item strong {
    flex: 1 1 100%;
}

.supplier-list-item span:last-child {
    margin-left: auto;
    font-weight: 700;
    color: var(--green-dark);
}

.my-hub-panel-orders .order-card {
    border-left: 3px solid var(--green);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .my-hub-panel,
[data-theme="royal"] .my-hub-panel {
    background: var(--surface);
}

[data-theme="dark"] .my-hub-listing,
[data-theme="royal"] .my-hub-listing,
[data-theme="dark"] .my-hub-panel-orders .order-card,
[data-theme="royal"] .my-hub-panel-orders .order-card {
    background: var(--surface);
}

[data-theme="dark"] .services-intro-card,
[data-theme="royal"] .services-intro-card {
    background: linear-gradient(135deg, rgba(30, 90, 168, 0.18) 0%, rgba(46, 175, 90, 0.12) 100%);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

[data-theme="dark"] .services-intro-icon,
[data-theme="royal"] .services-intro-icon {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.screen-body {
    padding-top: 16px;
    padding-bottom: 24px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: clip;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 0 14px;
    min-height: var(--touch-min);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--text);
    min-width: 0;
}

.search-bar input:focus {
    outline: none;
}

.search-bar svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Services grid (icon + name tiles) */

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.empty-state.hidden {
    display: none;
}

/* Service detail sheet */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
}

.service-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 201;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    animation: sheetUp 0.28s ease;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.service-sheet::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.sheet-form-wrap {
    text-align: left;
    padding: 0 16px 8px;
    max-width: 100%;
    margin: 0 auto;
}

.sheet-form-wrap .sheet-icon-wrap,
.sheet-form-wrap h2,
.sheet-form-wrap .sheet-desc,
.sheet-form-wrap .sheet-order-estimate {
    text-align: center;
}

.service-request-form textarea {
    width: 100%;
    max-width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    box-sizing: border-box;
    resize: vertical;
}

.service-request-form textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(30,90,168,.12);
}

.me-requests-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.me-request-item {
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.me-request-item strong {
    font-size: 14px;
    color: var(--text);
}

.me-request-item span {
    font-size: 12px;
    color: var(--text-muted);
}

.me-empty {
    font-size: 14px;
    color: var(--text-muted);
    padding: 12px 0;
    text-align: center;
}

.me-empty.hidden {
    display: none;
}

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    margin: 0 auto 16px;
}

.sheet-content h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.sheet-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 16px;
}

.sheet-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

/* Me screen  avatar + name always visible on Me tab */
.me-profile,
#meTopProfile,
#meTopProfile.hidden {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    width: 100%;
    max-width: 100%;
    padding: 8px 0 12px;
    visibility: visible !important;
    opacity: 1 !important;
}

.me-avatar-wrap,
#meAvatarBtn,
#meAvatar {
    visibility: visible !important;
}

.me-avatar-wrap {
    position: relative;
    display: flex !important;
    justify-content: center;
}

.me-avatar-btn {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.me-avatar-btn.me-avatar-readonly .me-avatar-edit {
    display: none;
}

.me-profile .screen-title,
.me-profile .screen-sub {
    text-align: center;
}

.me-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--blue-light);
    color: var(--blue);
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 3px solid var(--surface);
    box-shadow: var(--shadow);
}

.me-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.me-avatar-img.hidden {
    display: none !important;
}

.me-avatar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.me-avatar-icon.hidden {
    display: none !important;
}

.me-avatar-edit {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
    box-shadow: var(--shadow-sm);
    pointer-events: none;
}

.me-section {
    margin-bottom: 24px;
}

.me-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-align: center;
}

.me-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.me-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    min-height: var(--touch-min);
}

.me-link svg {
    color: var(--blue);
}

.me-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 16px 0 8px;
}

.me-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: var(--touch-min);
}

.setting-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.me-lang-head {
    margin-bottom: 0;
}

.me-lang-view {
    margin-top: 10px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.me-lang-current {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.me-lang-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.me-lang-choice {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    text-align: left;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    min-height: var(--touch-min);
    transition: border-color var(--transition), background var(--transition);
}

.me-lang-choice.active {
    border-color: var(--blue);
    background: var(--blue-light);
}

.me-lang-choice-code {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    color: var(--blue);
    background: var(--bg);
    flex-shrink: 0;
}

.me-lang-choice.active .me-lang-choice-code {
    background: var(--blue);
    color: #fff;
}

.me-lang-choice-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.me-lang-cancel {
    width: 100%;
    margin-top: 4px;
}

.me-settings .lang-toggle {
    flex-shrink: 0;
}

.me-section-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: -12px 0 12px;
}

.me-theme-head {
    margin-bottom: 0;
}

.me-theme-head .me-label {
    margin-bottom: 0;
    text-align: left;
}

.me-theme-view {
    margin-top: 10px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.me-theme-current {
    display: flex;
    align-items: center;
    gap: 14px;
}

.me-theme-current-swatch {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.me-theme-current-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.me-theme-picker {
    margin-top: 10px;
}

.me-theme-picker-hint {
    margin: 0 0 10px;
    text-align: left;
}

.me-theme-cancel {
    width: 100%;
    margin-top: 12px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.theme-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    min-height: var(--touch-min);
}

.theme-card:active {
    transform: scale(0.98);
}

.theme-card.active {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(30, 90, 168, 0.15);
}

.theme-swatch {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--swatch-a) 0%, var(--swatch-b) 100%);
    box-shadow: var(--shadow-sm);
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.theme-card-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    line-height: 1.2;
}

.setting-row-toggle {
    cursor: pointer;
    align-items: center;
}

.setting-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.setting-hint {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.35;
}

.setting-switch {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 28px;
}

.setting-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.setting-switch-track {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-xl);
    background: var(--border);
    transition: background var(--transition);
    position: relative;
}

.setting-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition);
}

.setting-switch input:checked + .setting-switch-track {
    background: var(--blue);
}

.setting-switch input:checked + .setting-switch-track::after {
    transform: translateX(20px);
}

.setting-switch input:focus-visible + .setting-switch-track {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.me-account-form {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.me-account-form .btn,
.me-account-form .form-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    margin-inline: auto;
    text-align: center;
}

/* Themes */
[data-theme="dark"] {
    --bg:          #0F1419;
    --surface:     #1A2332;
    --text:        #E8ECF0;
    --text-muted:  #9CA3AF;
    --border:      #2D3748;
    --blue-light:  rgba(30, 90, 168, 0.25);
    --green-light: rgba(46, 175, 90, 0.2);
    --gold-light:  rgba(245, 166, 35, 0.15);
    --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow:      0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.35);
    --wallet-gradient: linear-gradient(145deg, #1A2332 0%, #1E5AA8 55%, #2EAF5A 100%);
    --hub-gradient: linear-gradient(145deg, #1A2332 0%, #1E5AA8 50%, #2EAF5A 100%);
    --hub-shell-gradient: linear-gradient(135deg, #1E5AA8 0%, #2EAF5A 60%, #F5A623 100%);
}

[data-theme="ocean"] {
    --blue:        #0891B2;
    --blue-dark:   #0E7490;
    --blue-light:  #E0F7FA;
    --green:       #06B6D4;
    --green-dark:  #0891B2;
    --green-light: #CFFAFE;
    --bg:          #F0F9FF;
    --surface:     #FFFFFF;
    --text:        #0C4A6E;
    --text-muted:  #64748B;
    --border:      #BAE6FD;
    --wallet-gradient: linear-gradient(145deg, #0E7490 0%, #0891B2 50%, #06B6D4 100%);
}

[data-theme="sunset"] {
    --blue:        #EA580C;
    --blue-dark:   #C2410C;
    --blue-light:  #FFEDD5;
    --green:       #F59E0B;
    --green-dark:  #D97706;
    --green-light: #FEF3C7;
    --gold:        #FBBF24;
    --bg:          #FFFBEB;
    --surface:     #FFFFFF;
    --text:        #431407;
    --text-muted:  #78716C;
    --border:      #FED7AA;
    --wallet-gradient: linear-gradient(145deg, #C2410C 0%, #EA580C 50%, #F59E0B 100%);
}

[data-theme="forest"] {
    --blue:        #15803D;
    --blue-dark:   #166534;
    --blue-light:  #DCFCE7;
    --green:       #22C55E;
    --green-dark:  #16A34A;
    --green-light: #BBF7D0;
    --bg:          #F0FDF4;
    --surface:     #FFFFFF;
    --text:        #14532D;
    --text-muted:  #64748B;
    --border:      #BBF7D0;
    --wallet-gradient: linear-gradient(145deg, #166534 0%, #15803D 50%, #22C55E 100%);
}

[data-theme="royal"] {
    --blue:        #7C3AED;
    --blue-dark:   #6D28D9;
    --blue-light:  rgba(124, 58, 237, 0.2);
    --green:       #A78BFA;
    --green-dark:  #8B5CF6;
    --green-light: rgba(167, 139, 250, 0.15);
    --gold:        #FBBF24;
    --bg:          #12082A;
    --surface:     #1E1033;
    --text:        #F3E8FF;
    --text-muted:  #C4B5FD;
    --border:      #4C1D95;
    --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow:      0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.4);
    --wallet-gradient: linear-gradient(145deg, #4C1D95 0%, #7C3AED 50%, #A78BFA 100%);
}

[data-theme="dark"] .bottom-nav,
[data-theme="royal"] .bottom-nav {
    background: rgba(26, 35, 50, 0.95);
}

[data-theme="royal"] .bottom-nav {
    background: rgba(30, 16, 51, 0.95);
}

[data-theme="dark"] .form-message.error,
[data-theme="royal"] .form-message.error {
    background: rgba(185, 28, 28, 0.2);
    color: #FCA5A5;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="royal"] input,
[data-theme="royal"] select,
[data-theme="royal"] textarea {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .theme-card.active,
[data-theme="royal"] .theme-card.active {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

/* Display preferences */
[data-text-size="large"] {
    font-size: 17px;
}

[data-text-size="large"] .screen-title {
    font-size: 26px;
}

[data-text-size="large"] .dash-balance-value {
    font-size: 36px;
}

[data-compact="true"] .dash-card {
    padding: 14px;
    margin-bottom: 12px;
}

[data-compact="true"] .me-section {
    margin-bottom: 18px;
}

[data-compact="true"] .setting-row {
    padding: 12px 14px;
}

[data-compact="true"] .screen-body {
    padding-bottom: 12px;
}

[data-reduce-motion="true"] *,
[data-reduce-motion="true"] *::before,
[data-reduce-motion="true"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

.balance-hidden {
    letter-spacing: 0.12em;
}

.features-list-compact .feature-item {
    padding: 16px;
}

/* Splash loader */
.app-splash {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: var(--bg);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.app-splash.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-orbit {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    animation: splashPulse 1.6s ease-in-out infinite;
}

.splash-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid transparent;
}

.splash-ring-outer {
    inset: 0;
    border-top-color: var(--blue);
    border-right-color: rgba(30, 90, 168, 0.25);
    animation: splashSpin 1.1s linear infinite;
}

.splash-ring-inner {
    inset: 10px;
    border-bottom-color: var(--green);
    border-left-color: rgba(46, 175, 90, 0.25);
    animation: splashSpin 0.85s linear infinite reverse;
}

.splash-tagline {
    font-family: var(--font-brand);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--blue);
    text-align: center;
}

.splash-tagline span {
    color: var(--green);
    letter-spacing: 0.2em;
}

@keyframes splashSpin {
    to { transform: rotate(360deg); }
}

@keyframes splashPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}

/* Auth screen */
.auth-wrap {
    min-height: auto;
    padding: 24px 16px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 480px;
    margin-inline: auto;
    box-sizing: border-box;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    margin-bottom: 28px;
}

.auth-orbit {
    flex-shrink: 0;
    align-self: center;
    margin: 0 auto 16px;
}

.auth-orbit .splash-logo {
    width: 104px;
    height: 104px;
}

.auth-title {
    font-family: var(--font-brand);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 6px;
    line-height: 1.15;
    width: 100%;
    text-align: center;
}

.auth-title span {
    color: var(--green);
    letter-spacing: 0.16em;
}

.auth-sub {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    width: 100%;
    max-width: 320px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
    width: 100%;
    align-self: stretch;
    justify-items: stretch;
}

.auth-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    padding: 12px 8px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    min-height: var(--touch-min);
    text-align: center;
}

.auth-tab.active {
    background: var(--blue);
    color: #fff;
}

.auth-panels {
    flex: 1;
    width: 100%;
    align-self: stretch;
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.auth-panel .form-group {
    margin-bottom: 14px;
}

.auth-panel .btn,
.auth-panel .form-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    margin-inline: auto;
    margin-top: 8px;
    text-align: center;
}

.auth-panel .form-message {
    text-align: center;
}

/* Buyer orders ecosystem */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-card {
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.order-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.order-card-top strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.order-summary {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 10px;
}

.order-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.order-amount {
    font-size: 13px;
    font-weight: 700;
    color: var(--blue);
}

.order-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: var(--radius-xl);
    flex-shrink: 0;
}

.order-status-pending {
    background: var(--gold-light);
    color: var(--gold-dark);
}

.order-status-processing {
    background: var(--blue-light);
    color: var(--blue);
}

.order-status-completed {
    background: var(--green-light);
    color: var(--green-dark);
}

.order-card-compact {
    padding: 12px 14px;
}

.order-card-compact .order-summary {
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sheet-order-estimate {
    font-size: 14px;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 14px;
    padding: 10px 14px;
    background: var(--green-light);
    border-radius: var(--radius);
    text-align: center;
}

[data-theme="dark"] .sheet-order-estimate {
    color: var(--green);
    background: rgba(46, 175, 90, 0.15);
}

.order-intent {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: var(--radius-xl);
    flex-shrink: 0;
}

.order-intent-buy {
    background: var(--blue-light);
    color: var(--blue);
}

.order-intent-sell {
    background: var(--green-light);
    color: var(--green-dark);
}

.order-card-foot .order-status {
    display: inline;
    padding: 0;
    background: none;
    font-size: inherit;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-muted);
}

.intent-toggle {
    width: 100%;
}

/* Auth  mobile center (must stay after .app-screen.active) */
body.auth-mode #screen-auth.active {
    flex: 1;
}

body.auth-mode .auth-wrap {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding-inline: 16px;
    box-sizing: border-box;
    align-items: center;
}

body.auth-mode .auth-brand,
body.auth-mode .auth-tabs,
body.auth-mode .auth-panels,
body.auth-mode .auth-panel.active {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

body.auth-mode .auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body.auth-mode .auth-orbit {
    margin-inline: auto;
}

body.auth-mode .auth-title,
body.auth-mode .auth-sub {
    text-align: center;
    margin-inline: auto;
}

body.auth-mode .auth-tab {
    width: 100%;
    justify-content: center;
    text-align: center;
}

/* Marketplace ecosystem */
.marketplace-wrap {
    padding: 0 16px 12px;
    text-align: left;
}

.marketplace-head {
    text-align: center;
    margin-bottom: 14px;
}

.marketplace-head h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.2px;
}

.sheet-desc-box {
    text-align: left;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--green);
    border-radius: var(--radius);
    margin-bottom: 4px;
}

.sheet-desc-box .sheet-desc {
    font-size: 15px;
    line-height: 1.55;
    word-break: break-word;
}

.sheet-desc-box:has(.sheet-desc:empty) {
    display: none;
}

.marketplace-head .sheet-desc {
    font-size: 14px;
    color: var(--text);
    line-height: 1.55;
    margin: 0;
}

.marketplace-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.45;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.marketplace-hint:empty {
    display: none;
}

.marketplace-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: 14px;
}

.marketplace-search {
    margin-bottom: 12px;
}

.marketplace-tab {
    padding: 10px 8px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    font-family: inherit;
    cursor: pointer;
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.marketplace-tab.active {
    background: var(--surface);
    color: var(--blue);
    box-shadow: var(--shadow-sm);
}

.marketplace-panel {
    display: none;
}

.marketplace-panel.active {
    display: block;
}

.listing-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 42vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.listing-grid::-webkit-scrollbar {
    display: none;
}

.listing-card {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: transform var(--transition), box-shadow var(--transition);
}

.listing-card:active {
    transform: scale(0.99);
}

.listing-card-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
}

.listing-card-img-placeholder {
    background: linear-gradient(135deg, var(--blue-light), var(--green-light));
}

.listing-card-body {
    flex: 1;
    min-width: 0;
}

.listing-card-supplier {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.listing-card-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.25;
}

.listing-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.listing-card-region {
    color: var(--text-muted);
}

.listing-card-price {
    color: var(--green-dark);
    font-size: 13px;
}

.listing-card-cta {
    margin-left: auto;
    font-weight: 700;
    color: var(--blue);
    font-size: 12px;
}

.listing-detail {
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.listing-detail-img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.listing-detail-supplier {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.listing-detail-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.listing-detail-desc,
.listing-detail-meta {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
}

.listing-detail-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--green-dark);
    margin-top: 8px;
}

.mp-back-btn {
    margin-bottom: 10px;
    padding-left: 0;
}

.listing-image-preview {
    margin-top: 8px;
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 120px;
}

.listing-image-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.supplier-listing-form .form-submit,
#serviceRequestForm .form-submit {
    width: 100%;
    max-width: none;
}

.marketplace-sheet .sheet-close {
    width: 100%;
    margin-top: 8px;
}

/* Wallet top-up sheet */
.wallet-sheet .wallet-sheet-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: var(--blue-light);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-sheet .wallet-sheet-icon svg {
    width: 28px;
    height: 28px;
}

.wallet-topup-form .form-group {
    margin-bottom: 14px;
}

.topup-amount-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.topup-chip {
    padding: 10px 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    min-height: 40px;
}

.topup-chip.active {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
}

.wallet-providers {
    border: none;
    padding: 0;
    margin: 0 0 14px;
    text-align: center;
}

.wallet-providers legend {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: left;
    width: 100%;
}

.provider-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    justify-items: stretch;
}

.provider-grid-single {
    grid-template-columns: 1fr;
    max-width: 160px;
    margin-inline: auto;
}

.provider-option-single {
    padding: 14px 12px;
    gap: 8px;
    border-color: var(--blue);
    background: var(--blue-light);
}

.provider-option-single:has(input:checked) {
    box-shadow: 0 0 0 2px rgba(30, 90, 168, 0.2);
}

.provider-logo-large {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: #fff;
    padding: 4px;
    box-sizing: border-box;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.provider-option-single span {
    font-size: 12px;
    font-weight: 800;
}

.provider-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    padding: 6px 2px;
    margin-bottom: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    min-height: 0;
    position: relative;
    background: var(--surface);
    box-sizing: border-box;
}

.provider-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.provider-logo {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
    object-position: center center;
    border-radius: 8px;
    flex-shrink: 0;
    margin-inline: auto;
}

.provider-option span {
    display: block;
    width: 100%;
    line-height: 1.1;
    color: var(--text);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
    box-sizing: border-box;
}

.provider-option:has(input:checked) {
    border-color: var(--blue);
    background: var(--blue-light);
    box-shadow: 0 0 0 1px rgba(30, 90, 168, 0.12);
}

.provider-option:has(input:checked) span {
    color: var(--blue);
}

.provider-option:active {
    transform: scale(0.97);
}

/* Mini-app manager */
.service-sheet.miniapp-studio-mode .marketplace-tabs {
    display: none;
}

.service-sheet.miniapp-studio-mode .marketplace-head {
    text-align: left;
}

.service-sheet.miniapp-studio-mode .sheet-desc-box {
    background: linear-gradient(135deg, rgba(123, 31, 162, 0.08), rgba(30, 90, 168, 0.06));
    border-color: rgba(123, 31, 162, 0.15);
}

.service-sheet.miniapp-studio-mode #sheetTitle {
    font-family: var(--font-brand);
    color: #6A1B9A;
}

.miniapp-studio-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #F3E5F5 0%, #E8F0FA 100%);
    border: 1px solid rgba(123, 31, 162, 0.12);
}

.miniapp-studio-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(145deg, #7B1FA2, #9C27B0);
    color: #fff;
    box-shadow: 0 4px 12px rgba(123, 31, 162, 0.25);
}

.miniapp-studio-icon svg {
    width: 22px;
    height: 22px;
}

.miniapp-studio-title {
    font-family: var(--font-brand);
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 4px;
    color: #4A148C;
}

.miniapp-studio-sub {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted);
    margin: 0;
}

.miniapp-hint {
    margin-bottom: 12px;
}

.miniapp-empty-note {
    font-size: 13px;
    color: var(--text-muted);
    margin: -4px 0 12px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

[data-theme="dark"] .miniapp-studio-banner,
[data-theme="royal"] .miniapp-studio-banner {
    background: linear-gradient(135deg, rgba(123, 31, 162, 0.2), rgba(30, 90, 168, 0.12));
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .miniapp-studio-title,
[data-theme="royal"] .miniapp-studio-title {
    color: #CE93D8;
}

[data-theme="dark"] .service-sheet.miniapp-studio-mode #sheetTitle,
[data-theme="royal"] .service-sheet.miniapp-studio-mode #sheetTitle {
    color: #CE93D8;
}

.miniapp-section-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text);
}

.miniapp-signin {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
}

.miniapp-preview-wrap {
    margin-bottom: 18px;
}

.miniapp-preview-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: left;
}

.miniapp-preview-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.miniapp-preview-img-placeholder {
    background: linear-gradient(145deg, #F3E5F5, #E1BEE7);
}

.miniapp-preview-body {
    flex: 1;
    min-width: 0;
}

.miniapp-preview-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #F3E5F5;
    color: #7B1FA2;
    margin-bottom: 6px;
}

.miniapp-preview-title {
    display: block;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text);
}

.miniapp-preview-tagline {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    margin: 0 0 6px;
}

.miniapp-preview-meta,
.miniapp-preview-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 6px;
    line-height: 1.4;
}

.miniapp-preview-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.miniapp-preview-foot strong {
    color: var(--text);
    font-size: 13px;
}

.miniapp-form {
    text-align: left;
}

.marketplace-sheet .marketplace-tabs.hidden {
    display: none;
}

/* Escrow wallet */
.dash-escrow {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-escrow strong {
    color: var(--orange-dark, #c2410c);
    font-weight: 700;
}

/* Order escrow badges */
.order-escrow {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.order-escrow-held {
    background: var(--orange-light, #ffedd5);
    color: var(--orange-dark, #c2410c);
}

.order-escrow-released {
    background: var(--green-light);
    color: var(--green-dark);
}

.order-escrow-refunded {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Order actions & reviews */
.order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.order-actions .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: auto;
}

.review-box {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.review-prompt {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.star-picker {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.star-pick {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--border);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.star-pick.active,
.star-pick:hover {
    color: #f59e0b;
}

.review-comment {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    background: var(--surface);
    color: var(--text);
}

.review-thanks {
    font-size: 13px;
    color: var(--green-dark);
    font-weight: 600;
}

/* Star ratings */
.star-rating {
    display: inline-flex;
    gap: 1px;
    vertical-align: middle;
}

.star-rating .star {
    color: var(--border);
    font-size: 14px;
    line-height: 1;
}

.star-rating .star-on {
    color: #f59e0b;
}

.star-rating-sm .star {
    font-size: 11px;
}

.listing-card-rating {
    display: block;
    margin: 2px 0 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.listing-card-rating small {
    font-size: 10px;
}

/* Supplier dashboard (legacy hooks - see My Hub section above) */

.search-results-section {
    margin-top: 20px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.search-results-title {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text);
}

.search-results-grid {
    max-height: none;
}

.search-result-card {
    text-align: left;
}

.search-result-hub {
    font-size: 11px;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-list-compact .activity-card {
    padding: 10px 12px;
}

.activity-card {
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.activity-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.activity-card-top strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    text-align: right;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-type {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

.activity-type-order {
    background: var(--blue-light);
    color: var(--blue);
}

.activity-type-sale {
    background: var(--green-light);
    color: var(--green-dark);
}

.activity-type-listing {
    background: #FEF3C7;
    color: #B45309;
}

.activity-type-topup {
    background: #EDE9FE;
    color: #6D28D9;
}

.activity-type-miniapp {
    background: #F3E5F5;
    color: #7B1FA2;
}

.activity-summary {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 8px;
    line-height: 1.35;
}

.activity-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.activity-amount {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.order-list-compact .order-card {
    margin-bottom: 10px;
}

/* Notifications & order badges */
.bottom-nav-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: var(--orange-dark, #ea580c);
    box-shadow: 0 0 0 2px var(--surface);
}

.bottom-nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    font-size: 9px;
}

.me-tab-title {
    margin: 0;
    padding: 8px 0 4px;
    text-align: center;
}

.me-tab-title.hidden {
    display: none;
}

.me-profile-head {
    margin-bottom: 10px;
}

.me-profile-head .me-label {
    margin-bottom: 0;
    text-align: left;
}

.me-profile-view {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
}

.me-profile-setup-btn {
    width: 100%;
    margin-top: 12px;
}

.me-profile-facts {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.me-profile-fact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.me-profile-fact dt {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.me-profile-fact dd {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.me-profile-form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.me-profile-form-actions .btn {
    width: 100%;
}

.me-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    min-width: 0;
}

.me-section-head .me-label {
    margin: 0;
    min-width: 0;
    flex: 1;
}

.me-section-head .link-btn {
    flex-shrink: 0;
}

.me-orders-badge {
    position: static;
    flex-shrink: 0;
}

.order-card-unread {
    border-color: rgba(30, 90, 168, 0.35);
    box-shadow: 0 0 0 1px rgba(30, 90, 168, 0.12);
}

.order-new-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
    background: var(--blue);
    vertical-align: middle;
}

.app-toast-wrap {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    width: min(92vw, 360px);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-toast {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.app-toast-success {
    border-left: 4px solid var(--green);
    background: linear-gradient(90deg, rgba(46, 175, 90, 0.1) 0%, var(--surface) 40%);
}

/* --- Responsive: fit all screen sizes without clipping --- */
.dash-card,
.me-settings,
.me-account-form,
.marketplace-wrap,
.services-step-body,
.sheet-form-wrap,
.dash-wallet-wrap,
.home-body {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.setting-row {
    min-width: 0;
}

.setting-row .link-btn {
    flex-shrink: 0;
}

.services-intro-steps {
    overflow: hidden;
}

.me-account-form .form-group input,
.me-account-form .form-group select,
.service-request-form input,
.service-request-form select,
.service-request-form textarea {
    max-width: 100%;
}

@media (max-width: 380px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .services-grid {
        gap: 8px;
    }

    .service-card {
        padding: 10px 4px;
    }

    .service-name {
        font-size: 10px;
    }

    .provider-grid {
        gap: 4px;
    }

    .provider-option {
        padding: 5px 1px;
        font-size: 8px;
    }

    .provider-logo {
        width: 26px;
        height: 26px;
    }

    .services-step {
        font-size: 9px;
        padding: 8px 2px;
        gap: 4px;
    }

    .services-step-num {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .theme-grid {
        gap: 8px;
    }

    .theme-swatch {
        width: 36px;
        height: 36px;
    }
}

@media (min-width: 768px) {
    .container {
        padding-left: 24px;
        padding-right: 24px;
    }
}
