/* Natige Orders — mobile-first UI */
:root {
    --bg: #eef2f7;
    --surface: #ffffff;
    --primary: #1e73b8;
    --primary-hover: #155a94;
    --primary-light: #e8f2fa;
    --primary-ring: rgba(30, 115, 184, 0.28);
    --accent: #d97706;
    --accent-hover: #b45309;
    --accent-light: #fef3e2;
    --accent-ring: rgba(217, 119, 6, 0.26);
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #16a34a;
    --success-bg: #ecfdf3;
    --success-border: #86efac;
    --warning: #ca8a04;
    --danger: #dc2626;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --header-h: 64px;
    --nav-h: 62px;
    --workflow-gap: 20px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(ellipse 100% 60% at 50% -8%, rgba(30, 115, 184, 0.14), transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(30, 115, 184, 0.06), transparent 45%),
        linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    padding: 0;
    padding-left: max(0, env(safe-area-inset-left));
    padding-right: max(0, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    font-size: 16px;
    line-height: 1.45;
    overflow-x: hidden;
    color: var(--text);
}

.container {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    min-width: 0;
    padding: 0 max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left));
}

#app-screen,
.app-main,
#profile-panel {
    min-width: 0;
    max-width: 100%;
}

/* Shell: height = viewport; workflow panels auto-fill the gap */
#app-screen {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

#app-screen .app-header {
    flex-shrink: 0;
}

#app-screen .app-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#app-screen .app-main:has(#orders-panel:not(.hidden)),
#app-screen .app-main:has(#exchange-panel:not(.hidden)) {
    overflow: hidden;
}

#app-screen .app-main:has(#profile-panel:not(.hidden)) {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.container:has(#app-screen:not(.hidden)) {
    padding-bottom: 0;
}

.hidden { display: none !important; }

/* ——— Login ——— */
#login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: max(32px, env(safe-area-inset-top)) 0 24px;
    min-height: min(100vh, 100dvh);
    justify-content: center;
}

.logo-wrap {
    text-align: center;
    margin-bottom: 32px;
    width: 100%;
}

.logo-wrap img {
    max-width: 220px;
    max-height: 88px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 8px 24px rgba(30, 115, 184, 0.12));
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 24px;
    width: 100%;
    max-width: 360px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-lg);
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-card .login-sub {
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-card .field { margin-bottom: 16px; }

.login-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    background: #fafbfc;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}

.login-card input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.login-card .btn-primary { margin-top: 8px; }

.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ——— Header ——— */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    margin: 0 calc(-1 * max(16px, env(safe-area-inset-right))) 20px calc(-1 * max(16px, env(safe-area-inset-left)));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--header-h);
}

.app-header .logo-mini {
    height: 40px;
    width: auto;
    max-width: 130px;
    object-fit: contain;
}

.app-header .user-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.app-header .greeting {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header .date-pill {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 999px;
}

.app-header .logout {
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 8px 12px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
    transition: background 0.15s var(--ease);
}

.app-header .logout:hover { background: var(--primary-light); }

.app-header .logout:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ——— Stepper ——— */
.steps-bar {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--surface);
    border-radius: 999px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.steps-bar .step {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 999px;
    transition: color 0.2s, background 0.2s;
}

.steps-bar .step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    background: var(--border);
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}

.steps-bar .step.active {
    color: var(--primary);
    background: var(--primary-light);
}

.steps-bar .step.active .step-num {
    background: var(--primary);
    color: #fff;
}

.steps-bar .step.done {
    color: var(--success);
}

.steps-bar .step.done .step-num {
    background: var(--success-bg);
    color: var(--success);
}

.steps-bar .step-connector {
    width: 8px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}

/* ——— Cards ——— */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(226, 232, 240, 0.9);
    min-width: 0;
    max-width: 100%;
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.step-eyebrow {
    margin: 0 0 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
}

.card .step-title,
.step-products-head h2 {
    font-weight: 700;
    color: var(--text);
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

/* ——— Step header with solid icon container (flat, touch-first) ——— */
.card-head--step {
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.step-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-head-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(30, 115, 184, 0.28);
}

.step-head-icon svg { width: 22px; height: 22px; }

/* Returns tab — warm amber accent to distinguish from Orders */
#exchange-panel .step-head-icon {
    background: var(--accent);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.26);
}
#exchange-panel .step-eyebrow { color: var(--accent); }
#exchange-panel .branch-search:focus,
#exchange-panel .product-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
}
#exchange-panel .branch-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}
#exchange-panel .branch-btn.selected {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.34);
}
#exchange-panel .branch-btn::after { color: var(--accent); }
#exchange-panel .selected-branch-chip {
    background: var(--accent-light);
    color: var(--accent-hover);
}

.selected-branch-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    max-width: 100%;
}

.selected-branch-chip svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* Progress */
.branch-progress-card { padding: 16px 20px; }

.branch-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.branch-progress-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.branch-progress-label .progress-nums {
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.progress-percent {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.progress-bar-wrap {
    height: 8px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.45s var(--ease), background 0.25s;
    min-width: 0;
}

.progress-bar-fill.progress-red { background: linear-gradient(90deg, #f87171, var(--danger)); }
.progress-bar-fill.progress-yellow { background: linear-gradient(90deg, #facc15, var(--warning)); }
.progress-bar-fill.progress-green { background: linear-gradient(90deg, #4ade80, var(--success)); }

/* Search inputs */
.branch-search,
.product-search {
    display: block;
    width: 100%;
    padding: 12px 14px 12px 42px;
    margin: 0 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    background-color: #fafbfc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.branch-search:focus,
.product-search:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--surface);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.branch-search::placeholder,
.product-search::placeholder { color: var(--text-muted); }

.branch-list-scroll {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 4px;
}

.branch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.branch-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    min-height: 52px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    word-break: break-word;
    transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.branch-btn .branch-name { flex: 1; min-width: 0; }

/* Leading store icon (mask lets it recolor per state) */
.branch-btn::before {
    content: "";
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background-color: var(--text-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l1-5h16l1 5'/%3E%3Cpath d='M4 9v10a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M3 9h18'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l1-5h16l1 5'/%3E%3Cpath d='M4 9v10a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M3 9h18'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: background-color 0.2s;
}

/* Trailing chevron affordance — only for pending branches */
.branch-btn::after {
    content: "";
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background-color: var(--text-muted);
    opacity: 0.45;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.branch-btn.selected::after,
.branch-btn.completed::after { display: none; }
.branch-btn.selected::before { background-color: #fff; }

.branch-btn .branch-status {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--success-bg);
    color: var(--success);
}

.branch-btn:not(.completed) .branch-status { display: none; }

.branch-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.branch-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.branch-btn.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(30, 115, 184, 0.35);
}

.branch-btn.selected .branch-status {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.branch-btn.completed:not(.selected) {
    border-color: var(--success-border);
    background: var(--success-bg);
}

.branch-btn:active { transform: scale(0.98); }

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.45;
}

.empty-state p {
    margin: 0;
    font-size: 0.9rem;
}

/* Products step */
#step-products.branch-completed {
    border-color: var(--success-border);
    background: linear-gradient(180deg, var(--success-bg) 0%, var(--surface) 24%);
}

.step-products-head {
    margin-bottom: 16px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px 12px 8px 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-back:hover {
    background: var(--border);
    color: var(--text);
}

.btn-back:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-back svg {
    width: 18px;
    height: 18px;
}

.product-list-wrap {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 4px;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    min-height: 56px;
    transition: background 0.15s;
}

.product-row:hover { background: #f8fafc; }

.product-row.has-qty {
    background: var(--primary-light);
}

/* Заполненная строка с категорией — подложка в цвете категории */
.product-row.has-cat.has-qty {
    background: color-mix(in srgb, var(--cat-color, #94a3b8) 14%, #ffffff);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat-color, #94a3b8) 28%, transparent);
}
.product-row.has-cat.has-qty::before {
    width: 5px;
    height: 72%;
}

/* Цветной индикатор категории — скруглённая «пилюля» у левого края */
.product-row.has-cat {
    position: relative;
    padding-left: 18px;
}
.product-row.has-cat::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    min-height: 22px;
    border-radius: 999px;
    background: var(--cat-color, #94a3b8);
}

.product-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 0;
    word-break: break-word;
    color: var(--text);
    line-height: 1.35;
}

.product-category-group {
    margin-bottom: 12px;
}

.product-category-group:last-child {
    margin-bottom: 0;
}

.product-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    padding: 7px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cat-color, var(--text-muted));
    background: color-mix(in srgb, var(--cat-color, #94a3b8) 12%, #ffffff);
    border-radius: 999px;
}

.product-category-stripe {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--cat-color, #94a3b8);
    flex-shrink: 0;
}

/* ——— Bottom navigation ——— */
.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 480px;
    z-index: 60;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.06);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s var(--ease);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active svg { transform: translateY(-1px); }

.nav-item:active { background: var(--primary-light); }

.nav-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.exchange-desc {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.exchange-form .field {
    margin-bottom: 14px;
}

.exchange-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.exchange-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    background: #fafbfc;
}

.exchange-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.exchange-qty-controls {
    justify-content: flex-start;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.qty-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.qty-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.qty-btn:active { transform: scale(0.94); }

.qty-input {
    width: 52px;
    min-width: 52px;
    padding: 10px 6px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    text-align: center;
    font-family: inherit;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--surface);
}

.qty-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* Sticky submit — sits above the bottom navigation */
.submit-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    width: 100%;
    max-width: 480px;
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
    z-index: 55;
    padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    background: linear-gradient(180deg, transparent 0%, rgba(238, 242, 247, 0.94) 30%, rgba(238, 242, 247, 0.99) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease), opacity 0.25s;
}

.submit-bar.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.submit-bar .btn-primary {
    margin: 0;
    box-shadow: 0 8px 24px rgba(30, 115, 184, 0.35);
}

/* Room for fixed bottom nav — same 20px gap as under the header */
#app-screen .app-main {
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--workflow-gap));
}

body.has-submit-bar #app-screen .app-main {
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 96px);
}

/* Workflow: card auto-height between header and bottom nav; list scrolls inside */
#orders-panel:not(.hidden),
#exchange-panel:not(.hidden) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#orders-panel > .msg.show,
#exchange-panel > .msg.show {
    flex-shrink: 0;
    margin-bottom: 12px;
}

#step-branches:not(.hidden),
#exchange-step-branches:not(.hidden),
#step-products:not(.hidden),
#exchange-step-products:not(.hidden) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    overflow: hidden;
}

#step-branches .card-head,
#exchange-step-branches .card-head,
#step-products .step-products-head,
#exchange-step-products .step-products-head {
    flex-shrink: 0;
}

#step-branches .branch-search,
#exchange-step-branches .branch-search,
#step-products .product-search:not(.hidden),
#exchange-step-products .product-search:not(.hidden) {
    flex-shrink: 0;
}

/* Report card — overflow-safe on narrow phones */
.card-report {
    background: linear-gradient(135deg, #f8fafc 0%, var(--surface) 100%);
    min-width: 0;
    overflow: hidden;
}

.card-report .card-head {
    margin-bottom: 0;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.card-report .report-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-report .report-body {
    flex: 1;
    min-width: 0;
}

.card-report .report-body .step-title,
.card-report .report-body p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.card-report p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.4;
}

.report-download-form { margin-top: 0; }

.report-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    width: 100%;
}

.report-buttons .report-download-form {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    margin-top: 0;
}

.report-buttons .btn {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
    padding: 12px 14px;
    min-height: 48px;
    font-size: 0.95rem;
}

@media (min-width: 400px) {
    .report-buttons:not(.report-buttons--single) {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .report-buttons:not(.report-buttons--single) .report-download-form {
        flex: 1 1 calc(50% - 5px);
        min-width: min(100%, 148px);
    }
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    min-height: 50px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s var(--ease), transform 0.12s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.btn:active:not(:disabled) { transform: scale(0.98); }

.btn-primary {
    background: linear-gradient(180deg, #2282c9 0%, var(--primary) 100%);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #1e73b8 0%, var(--primary-hover) 100%);
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.85;
}

/* Accent button — returns tab */
.btn-primary.btn-accent {
    background: linear-gradient(180deg, #ea8f16 0%, var(--accent) 100%);
}
.btn-primary.btn-accent:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
}
.submit-bar .btn-primary.btn-accent {
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.35);
}
.btn-primary.btn-accent:disabled {
    background: #94a3b8;
    box-shadow: none;
    opacity: 0.85;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    width: auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-ghost:hover { background: var(--primary-light); }

/* Messages */
.msg {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    display: none;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.msg.show { display: block; }

.msg.success {
    background: var(--success-bg);
    color: #14532d;
    border-color: var(--success-border);
}

.msg.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Skeleton */
.skeleton-list .skeleton-item {
    height: 52px;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
    margin-bottom: 8px;
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Overlays */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.overlay.show {
    display: flex;
    animation: fadeIn 0.2s var(--ease);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px 28px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.35s var(--ease);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.overlay .popup-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.overlay .popup-success {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.overlay.success .popup-loading { display: none; }
.overlay.success .popup-success { display: flex; }

.submit-spinner,
.dl-spinner {
    width: 48px;
    height: 48px;
    margin: 8px auto 16px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.overlay .popup-loading span,
.overlay .dl-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg { width: 28px; height: 28px; }

.success-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
    margin: 0;
}

.success-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.overlay .btn-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay .btn-close:hover {
    background: var(--border);
    color: var(--text);
}

.overlay .dl-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px;
}

.btn-outline {
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--border);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    width: auto;
    min-height: 44px;
}

/* ——— Profile panel ——— */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: linear-gradient(135deg, #2282c9 0%, var(--primary) 55%, var(--primary-hover) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 12px 30px rgba(30, 115, 184, 0.28);
}

.profile-avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.profile-hero-info {
    flex: 1;
    min-width: 0;
}

.profile-hero-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-hero-login {
    margin: 3px 0 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-hero-date {
    flex-shrink: 0;
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    white-space: nowrap;
}

.profile-hero-edit {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
.profile-hero-edit:hover { background: rgba(255, 255, 255, 0.3); }
.profile-hero-edit:active { transform: scale(0.94); }
.profile-hero-edit:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Модальное окно редактирования профиля */
.profile-edit-modal {
    max-width: 420px;
    text-align: left;
    padding: 24px 22px 26px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}
.profile-edit-title {
    margin: 0 0 18px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}
.profile-edit-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.profile-edit-close:hover { background: #f1f5f9; color: var(--text); }

/* Day summary dashboard */
.dash-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.dash-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 14px 6px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    text-align: center;
}

.dash-metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.dash-metric-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.2;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.dual-progress {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dual-progress-row {
    min-width: 0;
}

.dual-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.dual-progress-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.dual-progress-sub {
    margin: 6px 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.dual-progress-sub .progress-nums {
    color: var(--primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.progress-bar-fill.progress-exchange {
    background: linear-gradient(90deg, #8b5cf6, #6366f1);
}

/* Goal / streak card */
.goal-card {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px 14px;
}

.goal-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
}

.goal-body { flex: 1 1 120px; min-width: 0; }

.goal-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.goal-sub {
    margin: 3px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.goal-card.goal-reached {
    background: linear-gradient(135deg, #ecfdf3 0%, var(--surface) 60%);
    border-color: var(--success-border);
}

.goal-card.goal-reached .goal-icon {
    background: var(--success);
    color: #fff;
}

.goal-card.goal-reached .goal-title { color: #14532d; }

.streak-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

/* Remaining today */
.remaining-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.remaining-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}

.remaining-item:hover { background: var(--primary-light); border-color: var(--primary); }
.remaining-item:active { transform: scale(0.99); }
.remaining-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.remaining-item-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
}

.remaining-item-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.remaining-item-count {
    flex-shrink: 0;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    background: var(--primary);
    font-variant-numeric: tabular-nums;
}

.remaining-chevron { flex-shrink: 0; color: var(--text-muted); }

/* Top returns */
.top-returns-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-return-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.top-return-row:last-child { border-bottom: none; }

.top-return-rank {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    background: var(--primary-light);
    color: var(--primary);
}

.top-return-name {
    flex: 1;
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.top-return-qty {
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.profile-edit-modal .field { margin-bottom: 16px; }
.profile-edit-modal .field:last-of-type { margin-bottom: 0; }
.profile-edit-modal .btn-primary { margin-top: 18px; width: 100%; }

.profile-edit-modal label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.profile-edit-modal input[type="text"],
.profile-edit-modal input[type="password"] {
    width: 100%;
    min-height: 50px;
    padding: 13px 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    /* 16px обязателен: меньший шрифт вызывает авто-зум на iOS */
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    background: #f8fafc;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.profile-edit-modal input::placeholder { color: #94a3b8; }

.profile-edit-modal input[type="text"]:hover,
.profile-edit-modal input[type="password"]:hover {
    border-color: #cbd5e1;
}

.profile-edit-modal input[type="text"]:focus,
.profile-edit-modal input[type="password"]:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Password field with show/hide toggle */
.input-with-toggle { position: relative; }

.input-with-toggle input {
    width: 100%;
    padding-right: 48px;
}

.pw-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.pw-toggle:hover { color: var(--primary); background: var(--primary-light); }
.pw-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pw-toggle .pw-eye-off { display: none; }
.pw-toggle.is-visible .pw-eye { display: none; }
.pw-toggle.is-visible .pw-eye-off { display: block; }

.profile-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.profile-divider::before,
.profile-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.profile-guide {
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--primary);
    background: var(--primary-light);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.profile-guide:hover { background: #dcecfa; border-color: var(--primary); }
.profile-guide:active { background: #cfe4f7; }
.profile-guide:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.profile-logout {
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--danger);
    background: #fff;
    border: 1.5px solid rgba(220, 38, 38, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.profile-logout:hover { background: rgba(220, 38, 38, 0.06); border-color: var(--danger); }
.profile-logout:active { background: rgba(220, 38, 38, 0.12); }
.profile-logout:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }

@media (max-width: 480px) {
    .app-header .logo-mini { height: 44px; }
    .steps-bar .step span:not(.step-num) { display: none; }
    .steps-bar .step { padding: 10px 8px; }
    .card { padding: 16px; }
}

@media (max-width: 360px) {
    .dash-metrics { gap: 6px; }
    .dash-metric { padding: 12px 4px; }
    .dash-metric-value { font-size: 1.25rem; }
    .dash-metric-label { font-size: 0.65rem; }
    .goal-card .streak-badge { margin-left: 58px; }
    .report-buttons .btn {
        font-size: 0.9rem;
        padding: 11px 12px;
    }
}
