/* ============================================================
   Home — dashboard (route: #/home)
   ============================================================ */

/* ── S-HOME: DASHBOARD HOME ─────────────────────────────── */
#s-home { background: var(--surface-grey); overflow: hidden }

.hm-hdr-bg {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 212px;
    background: linear-gradient(160deg, #6d36ff 0%, #5426ce 50%, #3b169d 100%);
    border-radius: 0 0 16px 16px;
    z-index: 0
}

.hm-sb {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px 6px;
    flex-shrink: 0
}

.hm-sbt { font-size: 15px; font-weight: 600; color: var(--surface-white) }
.hm-sbi { display: flex; gap: 5px; align-items: center }

.hm-nav {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 6px 16px 12px;
    flex-shrink: 0
}
.hm-nav > :first-child { justify-self: start }
.hm-nav > :last-child { justify-self: end }

.hm-ava {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    border: 0.5px solid var(--surface-white);
    overflow: hidden;
    background: var(--purple-200);
    flex-shrink: 0
}

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

.hm-nav-title { font-size: 16px; font-weight: 700; color: var(--surface-white) }

.hm-nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0
}
.hm-scan {
    background: none;
    border: 0;
    padding: 0;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0
}
.hm-scan:active { opacity: 0.7 }

.hm-store-switch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--purple-500), var(--color-primary));
    border: 1.5px solid var(--surface-white);
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--surface-white);
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.15s ease
}
.hm-store-switch:active { transform: scale(0.96) }
.hm-store-switch img { display: block }
.hm-store-switch-init {
    color: var(--surface-white) !important;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .02em;
    line-height: 1;
    text-align: center
}
.hm-notif { position: relative; width: 24px; height: 24px; flex-shrink: 0 }

.hm-badge {
    position: absolute;
    top: -3px; right: -5px;
    background: var(--color-danger);
    color: var(--surface-white);
    font-size: 9px;
    font-weight: 700;
    width: 14px; height: 14px;
    border-radius: 8px;
    border: 2px solid #6f54b7;
    display: flex;
    align-items: center;
    justify-content: center
}

.hm-scroll {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 16px 110px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch
}
.hm-scroll::-webkit-scrollbar { display: none }

/* Store switcher card */
.hm-store-card {
    background: var(--surface-white);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    -webkit-tap-highlight-color: transparent;
    transition: background .12s, transform .12s
}
.hm-store-card:active { background: var(--purple-15); transform: scale(.99) }
.hm-store-card.single { cursor: default }
.hm-store-card.single:active { background: var(--surface-white); transform: none }
.hm-store-ico {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--purple-500), var(--color-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--surface-white);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .02em
}
.hm-store-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px
}
.hm-store-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink-900);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}
.hm-store-addr {
    font-size: 12px;
    color: var(--ink-300);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}
.hm-store-chev { flex-shrink: 0 }

/* Store picker bottom sheet */
.store-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 90;
    pointer-events: none;
    transition: background .25s ease
}
.store-sheet-backdrop.open {
    background: rgba(0,0,0,0.45);
    pointer-events: all
}
.store-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface-white);
    border-radius: 20px 20px 0 0;
    padding: 8px 16px 28px;
    z-index: 91;
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(0.34,1.4,0.64,1);
    display: flex;
    flex-direction: column;
    max-height: 75%;
    box-shadow: 0 -8px 28px rgba(0,0,0,0.16)
}
.store-sheet.open { transform: translateY(0) }
.store-sheet-handle {
    width: 36px;
    height: 4px;
    background: #D9D5E6;
    border-radius: 2px;
    margin: 4px auto 12px
}
.store-sheet-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink-900);
    padding: 0 4px 8px
}
.store-search {
    position: relative;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    background: var(--surface-white);
    border: 1px solid var(--border-weak);
    border-radius: 10px;
    padding: 8px 10px;
    gap: 8px
}
.store-search-ico { flex-shrink: 0 }
.store-search-inp {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--ink-900);
    min-width: 0
}
.store-search-inp::placeholder { color: var(--ink-300) }
.store-search-clear {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #D9D5E6;
    border: none;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent
}
.store-search-clear.show { display: flex }
.store-empty {
    text-align: center;
    color: var(--ink-300);
    font-size: 13px;
    padding: 24px 12px;
    display: none
}
.store-empty.show { display: block }

.store-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto
}
.store-list::-webkit-scrollbar { display: none }
.store-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s
}
.store-row:active { background: var(--purple-25) }
.store-row.selected { background: var(--purple-25) }
.store-row-ico {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--surface-white);
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0
}
.store-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px
}
.store-row-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}
.store-row-addr {
    font-size: 12px;
    color: var(--ink-300);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}
.store-row-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .15s, transform .15s
}
.store-row.selected .store-row-check {
    opacity: 1;
    transform: scale(1)
}

.store-row-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 1px
}
.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px 2px 5px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--surface-white);
    line-height: 1.2
}
.trend-badge.up { background: var(--color-success) }
.trend-badge.down { background: #EF4350 }
.store-role {
    font-size: 12px;
    color: #6B6770;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1.2
}
.role-emoji {
    font-size: 13px;
    line-height: 1
}

/* Income card */
.hm-income-card {
    background: linear-gradient(to bottom, #e4fff2, #f2fff9);
    border: 1px solid var(--surface-white-warm);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
    flex-shrink: 0
}

.hm-income-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px }
.hm-income-lbl { font-size: 14px; color: rgba(61,61,61,0.7) }
.hm-details-link { font-size: 16px; font-weight: 600; color: var(--color-primary); text-decoration: underline; cursor: pointer }

.hm-income-main { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px }
.hm-income-left { display: flex; align-items: center; gap: 6px }
.hm-income-val { font-size: 32px; font-weight: 600; color: var(--ink-700); white-space: nowrap }

.hm-up-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(38,170,104,0.1);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-success-dark)
}

.hm-income-net { font-size: 14px; color: var(--ink-500) }
.hm-income-net strong { font-weight: 600 }

/* AI Suggestion */
.hm-sugg-wrap {
    background: linear-gradient(to right, #f97ba6, #6e53b6);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    overflow: hidden;
    margin-top: 8px;
}

.hm-sugg-title { font-size: 16px; font-weight: 700; color: var(--surface-white) }

.hm-sugg-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory
}
.hm-sugg-scroll::-webkit-scrollbar { display: none }

.hm-sugg-card {
    flex: 0 0 100%;
    background: var(--surface-white-warm);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-snap-align: start
}

.hm-sugg-card-body { display: flex; gap: 4px; align-items: flex-start }

.hm-cal-ico {
    width: 40px;
    height: 40px;
    background: #fff2c4;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.hm-sugg-txt {
    font-size: 14px;
    color: rgba(50,14,154,0.7);
    line-height: 1.45;
    padding: 4px 8px;
    flex: 1
}

.hm-take-action {
    background: var(--purple-100);
    color: var(--color-primary);
    border: none;
    border-radius: 8px;
    height: 40px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .15s
}
.hm-take-action:active { opacity: .8 }

.hm-dots { display: flex; align-items: center; justify-content: center; gap: 8px }

.hm-dot { width: 8px; height: 8px; border-radius: 500px; background: rgba(254,254,254,0.2) }
.hm-dot.active { width: 31px; background: var(--surface-white-warm) }

/* AI Marketing card */
.hm-mkt-wrap { flex-shrink: 0; filter: drop-shadow(0 0 5px rgba(119,119,119,0.2)) }

.hm-mkt-card {
    background: linear-gradient(to bottom, #ffeaea, #e6ddff);
    border-left: 1px solid var(--surface-white-warm);
    border-right: 1px solid var(--surface-white-warm);
    border-top: 1px solid var(--surface-white-warm);
    border-radius: 16px;
    padding-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    overflow: hidden
}

.hm-mkt-hdr { display: flex; gap: 16px; align-items: flex-start; padding: 8px 16px 0; width: 100% }
.hm-mkt-ico { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center }
.hm-mkt-info { display: flex; flex-direction: column; gap: 4px; flex: 1 }
.hm-mkt-title { font-size: 18px; font-weight: 600; color: var(--ink-600); display: block }
.hm-mkt-sub { font-size: 14px; color: rgba(61,61,61,0.7); display: block }

.hm-mkt-body {
    background: rgba(254,254,254,0.5);
    width: 100%;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center
}

.hm-mkt-row { display: flex; align-items: center; justify-content: space-between; width: 100% }
.hm-mkt-lbl { font-size: 14px; color: var(--ink-500) }
.hm-mkt-status { display: flex; align-items: center; gap: 8px }
.hm-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-success-dark); box-shadow: 0 0 0 3px rgba(38,170,104,0.2) }
.hm-status-txt { font-size: 12px; font-weight: 700; color: var(--color-success-dark) }

.hm-slider-wrap { width: 100%; padding: 4px 0 }

.hm-slider-track {
    position: relative;
    height: 12px;
    border-radius: 100px;
    background: linear-gradient(to right,
        #8b1a1a  0%,
        #c0392b 12%,
        #e74c3c 22%,
        #e67e22 34%,
        #f1c40f 50%,
        #bdec2b 62%,
        #2ecc71 75%,
        #1d8348 100%
    );
    box-shadow: 0 1px 2px rgba(0,0,0,0.12)
}

.hm-slider-thumb {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--surface-white);
    border: 2.5px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2)
}

.hm-slider-labels {
    display: flex;
    width: 100%;
    font-size: 12px;
    color: #505967;
    padding-top: 6px
}

.hm-slider-labels span {
    flex: 1;
    line-height: 16px
}

.hm-boost-btn {
    width: calc(100% - 24px);
    height: 48px;
    background: linear-gradient(135deg, #a040ca 0%, #7b2fd8 50%, #5b099b 100%);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.4), 0 4px 12px rgba(91,9,155,0.35);
    border: none;
    border-radius: 8px;
    color: var(--surface-white);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .15s
}
.hm-boost-btn:active { opacity: .85 }

.hm-chevron-down { display: flex; align-items: center; justify-content: center }

.hm-view-more {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent
}

/* S1 back button */
.s1-back {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent
}
