/* ── tapii Portal CSS ─────────────────────────────────────────────── */
:root {
    --primary: #12b886;
    --primary-dark: #0c8c77;
    --secondary: #075f50;
    --accent: #e0492f;
    --accent-light: #ff7a59;
    --top-amber: #f6a609;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --bg: #f5f5f5;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6c757d;
    --border: #dee2e6;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); }

/* ── Header ─────────────────────────────────── */
.portal-header { background: var(--secondary); color: #fff; padding: 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1.5rem; max-width: 1280px; margin: 0 auto; }
.portal-logo { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 1.5rem; font-weight: 800; text-decoration: none; color: #fff; letter-spacing: -0.5px; }
.portal-logo-mark { width: 30px; height: 30px; border-radius: 8px; display: block; }
.logo-check { color: #fff; }
.logo-ki { color: var(--accent-light); }
.header-search { flex: 1; }
/* Admin area hides the public search; keep the header nav pinned to the right. */
.portal-header--admin .header-nav { margin-left: auto; }
.global-search { width: 100%; padding: 0.5rem 1rem; border-radius: 20px; border: none; font-size: 0.9rem; }
.header-nav { display: flex; align-items: center; gap: 0.75rem; }
.header-nav a { color: #fff; text-decoration: none; font-size: 1.2rem; }

/* ── Profile dropdown ───────────────────────── */
.profile-menu { position: relative; }
.profile-trigger { display: flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.12); border: none; border-radius: 20px; padding: 0.3rem 0.75rem 0.3rem 0.3rem; cursor: pointer; color: #fff; font-size: 0.88rem; transition: background 0.2s; white-space: nowrap; }
.profile-trigger:hover, .profile-menu:hover .profile-trigger, .profile-menu:focus-within .profile-trigger { background: rgba(255,255,255,0.22); }
.profile-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.profile-caret { font-size: 0.7rem; opacity: 0.8; transition: transform 0.2s; }
.profile-menu:hover .profile-caret, .profile-menu:focus-within .profile-caret { transform: rotate(180deg); }
.profile-dropdown { display: none; position: absolute; top: calc(100% + 6px); right: 0; background: #fff; border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,0.15); min-width: 170px; list-style: none; padding: 0.4rem 0; z-index: 200; }
.profile-dropdown::before { content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
.profile-menu:hover .profile-dropdown, .profile-menu:focus-within .profile-dropdown { display: block; }
.profile-dropdown li a, .profile-dropdown li button { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.55rem 1rem; color: var(--text); text-decoration: none; font-size: 0.9rem; background: none; border: none; cursor: pointer; text-align: left; transition: background 0.15s; }
.profile-dropdown li a:hover, .profile-dropdown li button:hover { background: var(--bg); }
.profile-divider { border-top: 1px solid var(--border); margin: 0.3rem 0; }

/* ── Category bar ───────────────────────────── */
.category-bar { display: flex; gap: 0.5rem; padding: 0.5rem 1.5rem; overflow-x: auto; max-width: 1280px; margin: 0 auto; border-top: 1px solid rgba(255,255,255,0.18); }
.cat-pill { padding: 0.3rem 0.8rem; border-radius: 20px; background: rgba(255,255,255,0.15); color: #fff; text-decoration: none; font-size: 0.85rem; white-space: nowrap; transition: background 0.2s; }
.cat-pill:hover, .cat-pill.active { background: var(--primary); }

/* ── Sub-category bar (shown on a category's listing page) ───────────────── */
.subcat-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.subcat-pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.9rem; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); color: var(--secondary); text-decoration: none; font-size: 0.85rem; white-space: nowrap; transition: all 0.15s; }
.subcat-pill:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.subcat-icon { font-size: 1rem; }

/* ── Buttons ────────────────────────────────── */
.btn-primary { background: var(--primary); color: #fff; border: none; padding: 0.6rem 1.4rem; border-radius: var(--radius); cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; transition: background 0.2s; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: transparent; color: var(--secondary); border: 2px solid var(--secondary); padding: 0.5rem 1.2rem; border-radius: var(--radius); cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; }
.btn-secondary:hover { background: var(--secondary); color: #fff; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.btn-full { width: 100%; text-align: center; }
/* Any disabled button reads as inactive (no per-button rule needed). */
.btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled, button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--primary); }

/* ── Hero ───────────────────────────────────── */
.hero { background: linear-gradient(135deg, var(--secondary), #12b886); color: #fff; padding: 3rem 1.5rem; text-align: center; }
.hero h1, .hero h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero-video-btn { margin-top: 1.25rem; padding: .7rem 1.6rem; font-size: 1rem; font-weight: 700; color: #fff;
    background: var(--accent, #e0492f); color: #fff; border: none; border-radius: 30px; cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: transform .15s ease, box-shadow .15s ease; }
.hero-video-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.32); }

/* Promo video lightbox */
.video-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.82);
    display: flex; align-items: center; justify-content: center; padding: 2rem; animation: vm-fade .2s ease; }
@keyframes vm-fade { from { opacity: 0; } to { opacity: 1; } }
.video-modal-inner { position: relative; width: min(960px, 95vw); }
.video-modal-inner video { width: 100%; border-radius: 12px; display: block; box-shadow: 0 30px 80px rgba(0,0,0,.5); background:#000; }
.video-modal-close { position: absolute; top: -42px; right: 0; width: 36px; height: 36px; border: none; border-radius: 50%;
    background: rgba(255,255,255,.15); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.video-modal-close:hover { background: rgba(255,255,255,.3); }
.blitzdeal-badge { background: var(--accent); color: #fff; border: none; border-radius: var(--radius); padding: 1rem 2rem; display: inline-block; margin: 1rem auto; font-weight: 700; }
.blitzdeal-badge .blitz-countdown { color: #fff; }
/* Hero blitz deals: white "floating" card on the teal hero for readability */
.hero-blitzdeal { background: #fff; border: 1px solid #eef1f0; border-radius: 14px; padding: 1.4rem 1.7rem; margin: 0; color: var(--text); text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,.18); min-width: 270px; max-width: 360px; }
.hero-blitzdeal h2 { color: var(--text); font-size: 1.3rem; margin: .45rem 0; }
.hero-blitzdeal p { color: var(--text-muted); font-size: .92rem; margin: .2rem 0; }
.blitzdeal-label { color: var(--accent); font-weight: 800; font-size: 1.1rem; }
.discount-badge { background: var(--primary); color: #fff; padding: 0.3rem 0.8rem; border-radius: 20px; font-weight: 700; }
.hero-blitzdeal-actions { display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.85rem; }
.blitzdeal-cta { text-decoration: none; }

/* ── Shared iOS-style toggle switch (also defined per-admin-page) ───────── */
.switch-row { display: flex; gap: .6rem; align-items: center; margin: .35rem 0; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 42px; height: 22px; flex: 0 0 auto; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider { position: absolute; inset: 0; cursor: pointer; background: #cbd5e1; border-radius: 999px; transition: background .2s; }
.switch-slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .switch-slider { background: #16a34a; }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ── Order modal: read-only name, delivery & payment blocks ───────────── */
.order-readonly { padding: .5rem .7rem; background: #f1f5f9; border-radius: 8px; font-weight: 600; color: var(--secondary); }
.order-block { border-top: 1px solid var(--border); padding-top: .8rem; margin-top: .4rem; }
.pay-options { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem; }
.pay-option { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: .9rem; }
.pay-option:hover { border-color: var(--primary); }
.pay-option input { margin: 0; }
.pay-details { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; padding: .55rem .7rem; font-size: .85rem; white-space: pre-wrap; word-break: break-word; margin: 0 0 .2rem; font-family: inherit; }
.pay-qr { max-width: 180px; border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.15); }

/* ── Blitz Deals Carousel ───────────────────── */
.blitz-carousel { width: 100%; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.blitz-carousel-row { display: flex; align-items: center; gap: .5rem; width: 100%; justify-content: center; }
.blitz-carousel-track { display: flex; gap: 1rem; justify-content: center; align-items: stretch; flex: 1; max-width: 1100px; animation: blitz-fade .35s ease; }
/* Equal-height cards: pin price/CTA to the bottom (home top offers + hero Акция). */
.offers-scroll .offer-card__footer, .blitz-carousel-track .offer-card__footer { margin-top: auto; }
@keyframes blitz-fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.blitz-carousel-btn { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,.92); color: var(--accent); font-size: 1.8rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s, transform .15s; padding: 0; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.blitz-carousel-btn:hover { background: #fff; transform: scale(1.06); }
.blitz-carousel-dots { display: flex; gap: .45rem; padding-bottom: .25rem; }
.blitz-dot { width: 10px; height: 10px; border-radius: 50%; border: none; padding: 0; background: rgba(224,73,47,.35); cursor: pointer; transition: background .2s, transform .2s; }
.blitz-dot.active { background: var(--accent); transform: scale(1.35); }
.blitz-carousel-track .hero-blitzdeal { flex: 1 1 0; min-width: 260px; max-width: 380px; margin: 0; display: flex; flex-direction: column; justify-content: center; }
.blitz-countdown { font-family: monospace; font-size: 1.1rem; font-weight: 700; color: var(--accent); }

/* ── Sections ───────────────────────────────── */
.portal-main { max-width: 1280px; margin: 0 auto; padding: 1.5rem; }
.section-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 1rem; color: var(--secondary); }
.section-offers, .section-categories { margin-bottom: 2rem; }
.offers-scroll { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; }
.login-banner { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; text-align: center; display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 2rem; box-shadow: var(--shadow); }
.login-banner p { color: var(--text-muted); }

/* ── Category grid ──────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
@media (max-width: 1024px) { .category-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 680px)  { .category-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 460px)  { .category-grid { grid-template-columns: repeat(2, 1fr); } }
.category-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; background: var(--surface); border-radius: var(--radius); padding: 1.5rem 1rem; min-height: 130px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform 0.2s; font-size: 0.9rem; text-align: center; }
.category-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.cat-tile-icon { font-size: 2.4rem; }
.cat-tile-name { font-weight: 600; }
.cat-tile-meta { font-size: 0.72rem; color: var(--primary); font-weight: 700; }

/* ── Per-category showcase (home "Популярные сравнения") ───────────── */
.section-showcase { margin-bottom: 2rem; }
.cat-showcase { margin-bottom: 1.75rem; }
.cat-showcase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.cat-showcase-head h3 { font-size: 1.15rem; font-weight: 700; color: var(--secondary); margin: 0; }
.cat-showcase-icon { margin-right: 0.25rem; }
.cat-showcase-all { font-size: 0.85rem; font-weight: 600; color: var(--primary); text-decoration: none; white-space: nowrap; }
.cat-showcase-all:hover { text-decoration: underline; }
.showcase-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 1024px) { .showcase-cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .showcase-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px)  { .showcase-cards { grid-template-columns: 1fr; } }
.showcase-card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; }
.showcase-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.14); }
.showcase-card-img { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #eef2f7, #dde5ee); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.showcase-card-img img { width: 100%; height: 100%; object-fit: cover; }
.showcase-card-ph { font-size: 2.8rem; opacity: 0.55; }
.showcase-badges { position: absolute; top: 0.5rem; left: 0.5rem; display: flex; flex-direction: column; gap: 0.3rem; }
.showcase-badge { font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 999px; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); white-space: nowrap; }
.badge-blitz { background: var(--accent, #f59e0b); color: #1f2937; }
.badge-top { background: var(--primary); }
.showcase-card-body { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.7rem 0.8rem 0.85rem; }
.showcase-card-title { font-weight: 700; font-size: 0.92rem; line-height: 1.25; overflow-wrap: anywhere; }
.showcase-card-sub { font-size: 0.78rem; color: var(--text-muted); }
.showcase-card-rating { font-size: 0.78rem; color: #d97706; font-weight: 600; }
.showcase-card-price { margin-top: 0.25rem; font-weight: 700; color: var(--secondary); font-size: 0.95rem; }
.showcase-card-unit { font-weight: 500; color: var(--text-muted); font-size: 0.78rem; }

/* ── Trust pillars (home) ───────────────────── */
.trust-section { margin-bottom: 2rem; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 768px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } }
.trust-pillar { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; text-align: center; }
.trust-icon { font-size: 1.8rem; }
.trust-pillar h3 { font-size: 1rem; margin: 0.5rem 0 0.35rem; color: var(--secondary); }
.trust-pillar p { font-size: 0.82rem; color: var(--text-muted); margin: 0; line-height: 1.45; }

/* ── Offer card ─────────────────────────────── */
.offer-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); min-width: 280px; max-width: 320px; flex-shrink: 0; position: relative; display: flex; flex-direction: column; transition: box-shadow 0.2s, transform 0.2s; }
.offer-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.13); transform: translateY(-2px); }
.offer-card--featured { border: 2px solid var(--accent); }
.offer-card--blitzdeal .blitzdeal-badge { font-size: 0.75rem; padding: 0.25rem 0.5rem; margin-bottom: 0.5rem; display: block; }
.offer-card__header { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; }
.offer-card__image { width: 72px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; cursor: zoom-in; }
/* Floating enlarged-image preview (driven by the hover/click script in App.razor). */
.img-hover-pop { position: fixed; z-index: 4000; background: #fff; padding: 5px; border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.32); pointer-events: none; opacity: 0; visibility: hidden; transform: scale(.95); transition: opacity .16s ease, transform .16s ease, visibility .16s; }
.img-hover-pop.show { opacity: 1; visibility: visible; transform: scale(1); }
.img-hover-pop img { display: block; width: 290px; height: 220px; object-fit: cover; border-radius: 7px; }
.showcase-card-img img { cursor: zoom-in; }
/* Full-size image lightbox (click a thumbnail). */
.img-lightbox { position: fixed; inset: 0; z-index: 5000; display: none; align-items: center; justify-content: center; padding: 2rem; background: rgba(0,0,0,.85); opacity: 0; transition: opacity .2s ease; cursor: zoom-out; }
.img-lightbox.show { opacity: 1; }
.img-lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.img-lightbox__close { position: absolute; top: 18px; right: 24px; width: 42px; height: 42px; border: none; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.img-lightbox__close:hover { background: rgba(255,255,255,.3); }
.img-lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border: none; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 2.2rem; line-height: 1; cursor: pointer; display: none; align-items: center; justify-content: center; }
.img-lightbox__nav:hover { background: rgba(255,255,255,.32); }
.img-lightbox__nav--prev { left: 24px; }
.img-lightbox__nav--next { right: 24px; }
.img-lightbox__count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: #fff; font-size: .9rem; font-weight: 600; background: rgba(0,0,0,.45); padding: .25rem .7rem; border-radius: 999px; display: none; }
.offer-card__info { flex: 1; min-width: 0; }
.offer-card__title { font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offer-card__description { font-size: 0.82rem; color: var(--text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.offer-card__stats { display: flex; gap: 0.5rem; font-size: 0.78rem; color: var(--text-muted); margin-bottom: auto; padding-bottom: 0.75rem; flex-wrap: wrap; }
.rating { color: #f59e0b; font-weight: 600; }
.orders-badge { background: #dcfce7; color: #166534; padding: 0.15rem 0.5rem; border-radius: 10px; font-weight: 600; }
.offer-card__footer { display: flex; justify-content: space-between; align-items: flex-end; padding-top: 0.75rem; border-top: 1px solid var(--border); margin-top: 0.5rem; }
/* Contact button (searcher → offering organisation) */
.btn-contact { background: #fff; color: var(--primary); border: 1px solid var(--primary); padding: 0.45rem 0.9rem; border-radius: var(--radius); font-size: 0.85rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.18s, color 0.18s; }
.btn-contact:hover:not(:disabled) { background: var(--primary); color: #fff; }
.btn-contact:disabled { opacity: 0.6; cursor: default; }
/* Offer lifetime progress (owner only) */
.offer-card__lifetime { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.25rem; }
.lifetime-bar { width: 100%; height: 6px; background: #e9ecef; border-radius: 4px; overflow: hidden; }
.lifetime-bar__fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.lifetime-label { font-size: 0.78rem; color: var(--text-light); }
/* Owner action row */
.offer-card__owner-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--border); }
.offer-card__cta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.offer-card__price { text-align: right; }
.price-amount { font-size: 1.35rem; font-weight: 800; color: var(--secondary); }
.price-unit { font-size: 0.78rem; color: var(--text-muted); }
.btn-book { display: inline-block; background: var(--primary); color: #fff; border: none; padding: 0.45rem 1rem; border-radius: var(--radius); font-size: 0.85rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background 0.18s; white-space: nowrap; }
.btn-book:hover { background: var(--primary-dark); color: #fff; }
.offer-card__actions { display: flex; gap: 0.5rem; align-items: center; }
.btn-heart { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--border); transition: color 0.2s; padding: 0; }
.btn-heart.active, .btn-heart:hover { color: var(--primary); }

/* ── Listing layout ─────────────────────────── */
.listing-layout { display: grid; grid-template-columns: 240px 1fr 240px; gap: 1.5rem; align-items: start; }
@media (max-width: 1024px) { .listing-layout { grid-template-columns: 200px 1fr; } .blitzdeal-sidebar { display: none; } }
@media (max-width: 768px) { .listing-layout { grid-template-columns: 1fr; } .filter-panel { display: none; } }
.filter-panel, .blitzdeal-sidebar { background: var(--surface); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.filter-field { margin-bottom: 0.75rem; }
.filter-field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.filter-field input, .filter-field select { width: 100%; padding: 0.4rem; border: 1px solid var(--border); border-radius: 4px; }
.listing-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.result-count { font-size: 0.9rem; color: var(--text-muted); }
.sort-select { padding: 0.4rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); }
/* Listing card = robust CSS grid: a wide content column + a fixed price/CTA
   column. Grid (not flex-wrap) guarantees the price block stays on the right
   regardless of title/description/price length — flex-wrap pushed it to a new
   line whenever the content got slightly wider (e.g. 4-digit prices in Reise).
   The blitz badge, owner lifetime bar and action buttons each span both
   columns on their own full-width rows. */
.listing-main .offer-card { min-width: unset; max-width: unset; margin-bottom: 1rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, auto); align-items: center; column-gap: 1.75rem; row-gap: 0.85rem; padding: 1.4rem 1.7rem; }
.listing-main .blitzdeal-badge,
.listing-main .offer-card__lifetime,
.listing-main .offer-card__owner-actions { grid-column: 1 / -1; }
.listing-main .offer-card__owner-actions { padding-top: 0.85rem; margin-top: 0; }
.listing-main .offer-card__header { grid-column: 1; margin-bottom: 0; align-items: center; }
.listing-main .offer-card__image { width: 128px; height: 96px; }
.listing-main .offer-card__title { white-space: normal; font-size: 1.12rem; }
.listing-main .offer-card__description { -webkit-line-clamp: 3; font-size: 0.95rem; line-height: 1.5; }
.listing-main .offer-card__stats { grid-column: 1; margin: 0; padding: 0; border: none; }
.listing-main .offer-card__stats:empty { display: none; }
.listing-main .offer-card__footer { grid-column: 2; flex-direction: column; align-items: flex-end; justify-content: center; border-left: 1px solid var(--border); border-top: none; padding: 0 0 0 1.5rem; margin: 0; gap: 0.6rem; }
/* Placement order so the price/CTA lands on the header's row, with the
   full-width owner rows (lifetime bar, action buttons) flowing below it —
   grid's sparse auto-placement would otherwise drop the footer a row. */
.listing-main .blitzdeal-badge { order: -2; }
.listing-main .offer-card__header,
.listing-main .offer-card__stats { order: -1; }
.listing-main .offer-card__footer { order: 0; }
.listing-main .offer-card__lifetime { order: 1; }
.listing-main .offer-card__owner-actions { order: 2; }
.pagination { display: flex; justify-content: center; gap: 1rem; margin-top: 1.5rem; align-items: center; }

/* ── Auth ───────────────────────────────────── */
.auth-container { display: flex; justify-content: center; align-items: center; min-height: 60vh; padding: 2rem; }
.auth-card { background: var(--surface); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.auth-card h2 { margin-bottom: 1.5rem; color: var(--secondary); }
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.form-control { width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; }
.form-control:focus { outline: 2px solid var(--primary); border-color: transparent; }
.auth-links { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.85rem; }
.auth-links a { color: var(--secondary); }

/* ── Alerts ─────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: #991b1b; border-left: 4px solid var(--primary); }
.alert-success { background: #f0fdf4; color: #166534; border-left: 4px solid #22c55e; }
.alert-info { background: #eff6ff; color: #1e40af; border-left: 4px solid #3b82f6; }

/* Account status banner under the header (email not verified / org awaiting approval) */
.account-banner { padding: .6rem 1rem; font-size: .9rem; font-weight: 600; text-align: center; }
.account-banner--warn { background: #fff7ed; color: #9a3412; border-bottom: 1px solid #fed7aa; }
.account-banner--info { background: #eff6ff; color: #1e40af; border-bottom: 1px solid #bfdbfe; }

/* ── Orders ─────────────────────────────────── */
.orders-list { display: flex; flex-direction: column; gap: 1rem; }
.order-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); border-left: 4px solid var(--border); }
.order-confirmed { border-left-color: #22c55e; }
.order-awaiting { border-left-color: #f59e0b; }
.order-cancelled { border-left-color: var(--primary); }
.order-pending { border-left-color: #f59e0b; }
.order-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.order-id { font-weight: 700; font-size: 0.85rem; color: var(--text-muted); }
.order-status { font-size: 0.8rem; padding: 0.2rem 0.6rem; border-radius: 10px; background: var(--bg); }
.order-card__actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* ── Admin ──────────────────────────────────── */
/* The admin/staff area spans a wide centered column (~90% of the viewport) — top panel,
   sidebar menu and content all share the same width, with equal margins on both sides.
   The blue header BAR itself is narrowed (not just its inner content) so its background
   stays within the same boundary; the inner row then fills that bar. */
.portal-main--admin { max-width: 90%; padding: 0; }
.portal-header--admin { max-width: 90%; margin: 0 auto; }
.portal-header--admin .header-inner { max-width: none; }
.admin-layout { display: grid; grid-template-columns: 250px 1fr; gap: 0; min-height: calc(100vh - 120px); }
.admin-sidebar { background: var(--secondary); color: #fff; padding: 1rem 0.55rem; display: flex; flex-direction: column; gap: 0; }
.admin-sidebar__brand { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: 0.75rem; font-size: 1.15rem; font-weight: 700; }
.admin-badge { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; background: var(--primary); color: #fff; padding: 0.15rem 0.45rem; border-radius: 4px; letter-spacing: 0.5px; }
.admin-sidebar ul { list-style: none; flex: 1; }
.admin-sidebar ul li a, .admin-sidebar ul li .active { display: flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.55rem; color: rgba(255,255,255,0.75); text-decoration: none; border-radius: 6px; font-size: 0.83rem; transition: background 0.15s, color 0.15s; margin-bottom: 2px; }
.admin-sidebar ul li a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.admin-sidebar ul li a.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 600; }
.admin-sidebar__footer { padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.15); margin-top: auto; }
.admin-sidebar__footer a { color: rgba(255,255,255,0.6); font-size: 0.82rem; text-decoration: none; }
.admin-sidebar__footer a:hover { color: #fff; }
.sidebar-section-label { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.35); padding: 0.85rem 0.55rem 0.25rem; pointer-events: none; }
/* Keep the leading icon glued to its label on one row (icon never drops to its own line). */
.admin-sidebar ul li a .nav-ico { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; text-align: center; }
/* Labels stay on a single line (no wrapping); ellipsis only as a last-resort safety. */
.admin-sidebar ul li a .nav-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Red "needs attention" badge next to a menu item, e.g. Заказы (5). */
.admin-sidebar ul li a .nav-badge { flex: 0 0 auto; margin-left: 0.35rem; background: #dc2626; color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1; padding: 0.2rem 0.42rem; border-radius: 999px; min-width: 1.1rem; text-align: center; }
.admin-sidebar ul li a.active .nav-badge { box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }
.portal-number-badge { font-family: var(--font-mono, monospace); font-size: 0.78rem; font-weight: 700; color: var(--secondary); background: rgba(30,64,175,0.08); border: 1px solid rgba(30,64,175,0.2); padding: 0.1rem 0.45rem; border-radius: 5px; white-space: nowrap; }
/* min-width:0 lets the 1fr grid column shrink below the table's intrinsic width
   instead of blowing the layout past the viewport (caused a stray h-scrollbar). */
.admin-main { padding: 1.5rem; min-width: 0; }
/* Informational badge in a section header: AI autonomy is active for that section. */
.autonomy-badge { display:inline-flex; align-items:center; gap:.3rem; font-size:.72rem; font-weight:600;
    line-height:1; padding:.3rem .55rem; border-radius:999px; white-space:nowrap; cursor:help;
    color:#6d28d9; background:#f5f3ff; border:1px solid #ddd6fe; }
/* Quick toggle filter chips (admin lists). */
.filter-chips { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; margin:.1rem 0 .9rem; }
.filter-chip { font-size:.78rem; font-weight:500; line-height:1; padding:.38rem .7rem; border-radius:999px;
    white-space:nowrap; cursor:pointer; color:#374151; background:#f3f4f6; border:1px solid #e5e7eb;
    transition:background .12s, border-color .12s, color .12s; }
.filter-chip:hover { background:#e5e7eb; }
.filter-chip.active { color:#fff; background:var(--primary); border-color:var(--primary); }
/* Wide admin tables scroll horizontally inside their own zone instead of pushing
   a page-level scrollbar. (Not used on the orgs table — it has an absolutely
   positioned hover popover that an overflow container would clip.) */
.admin-table-scroll { overflow-x: auto; }

/* ── AI Assistant upsell / status card (org dashboard) ───────────────────── */
.ai-card { display:flex; gap:1rem; background:linear-gradient(135deg,#eef2ff,#faf5ff); border:1px solid #c7d2fe; border-radius:var(--radius); padding:1.1rem 1.3rem; margin-bottom:1.25rem; }
.ai-card--on { background:linear-gradient(135deg,#ecfdf5,#f0fdf4); border-color:#a7f3d0; align-items:center; }
.ai-card--pending { background:#fffbeb; border-color:#fde68a; align-items:center; }
.ai-card__icon { font-size:1.8rem; line-height:1; flex-shrink:0; }
.ai-card__body { flex:1; min-width:0; }
.ai-card__title { font-size:1.05rem; color:var(--secondary); }
.ai-card__intro { font-size:.9rem; color:var(--text-muted); margin:.3rem 0 .5rem; }
.ai-card__feats { list-style:none; margin:.2rem 0 .6rem; padding:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.25rem .9rem; font-size:.86rem; }
.ai-card__price { font-size:.82rem; margin:.2rem 0 .6rem; }
.ai-card__consent { display:flex; gap:.5rem; align-items:flex-start; font-size:.86rem; margin-bottom:.7rem; cursor:pointer; }
.ai-card__consent input { margin-top:.2rem; }
@media (max-width:640px){ .ai-card__feats { grid-template-columns:1fr; } }

/* ── Floating AI Assistant (org cabinet) ─────────────────────────────────── */
.ai-fab-wrap { position:fixed; right:1.25rem; bottom:1.25rem; z-index:500; display:flex; flex-direction:column; align-items:flex-end; gap:.6rem; }
.ai-fab { width:56px; height:56px; border-radius:50%; border:none; background:linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff; font-size:1.5rem; cursor:pointer; box-shadow:0 6px 20px rgba(99,102,241,.45); transition:transform .15s; display:flex; align-items:center; justify-content:center; padding:0; overflow:hidden; }
.ai-fab:hover { transform:scale(1.06); }
/* Kakapo = the AI assistant's face */
.ai-face { object-fit:contain; display:block; }
.ai-face--fab { width:46px; height:46px; }
.ai-face--sm { display:inline-block; width:22px; height:22px; vertical-align:middle; margin-right:.25rem; }
/* Tiny inline variant for badges/pills — sits on one line next to short labels */
.ai-face--xs { display:inline-block; width:16px; height:16px; vertical-align:-3px; margin-right:.1rem; }
.ai-face--card { width:42px; height:42px; }
.ai-chat { width:min(370px,calc(100vw - 2.5rem)); height:min(520px,70vh); background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:0 12px 40px rgba(0,0,0,.22); display:flex; flex-direction:column; overflow:hidden; }
.ai-chat__head { display:flex; align-items:center; justify-content:space-between; padding:.7rem .9rem; background:linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff; font-weight:700; }
.ai-chat__close { background:none; border:none; color:#fff; font-size:1rem; cursor:pointer; }
.ai-chat__body { flex:1; overflow-y:auto; padding:.8rem; display:flex; flex-direction:column; gap:.5rem; background:#f8fafc; }
.ai-chat__greet { font-size:.85rem; color:var(--text-muted); text-align:center; margin:auto 0; padding:0 .5rem; }
.ai-msg { max-width:85%; padding:.5rem .7rem; border-radius:12px; font-size:.86rem; line-height:1.4; white-space:pre-wrap; word-break:break-word; }
.ai-msg--me { align-self:flex-end; background:#6366f1; color:#fff; border-bottom-right-radius:4px; }
.ai-msg--bot { align-self:flex-start; background:#fff; border:1px solid var(--border); color:var(--secondary); border-bottom-left-radius:4px; }
.ai-msg--typing { opacity:.6; font-style:italic; }
/* AI "generate description" button (offer create form + inline create panel) */
.btn-ai-generate { margin-top:.45rem; background:linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff; border:none; border-radius:8px; padding:.4rem .8rem; font-size:.84rem; font-weight:600; cursor:pointer; transition:opacity .15s; }
.btn-ai-generate:hover:not(:disabled) { opacity:.9; }
.btn-ai-generate:disabled { opacity:.55; cursor:default; }
.ai-gen-msg { margin-top:.35rem; font-size:.8rem; color:#b91c1c; }
.ai-chat__foot { display:flex; gap:.5rem; padding:.6rem; border-top:1px solid var(--border); align-items:flex-end; }
.ai-chat__foot textarea { flex:1; resize:none; border:1px solid var(--border); border-radius:10px; padding:.5rem .6rem; font-family:inherit; font-size:.86rem; max-height:90px; }
.ai-chat__send { background:#6366f1; color:#fff; border:none; border-radius:10px; width:38px; height:38px; cursor:pointer; font-size:1rem; flex-shrink:0; }
.ai-chat__send:disabled { opacity:.5; cursor:default; }
@media (max-width:640px){ .ai-fab-wrap { right:.8rem; bottom:.8rem; } }

/* Customer shopping assistant (distinct teal/green look vs the org's purple) */
.ai-fab--customer { background:linear-gradient(135deg,#0ea5e9,#10b981); box-shadow:0 6px 20px rgba(16,185,129,.45); font-size:1.6rem; }
.ai-chat__head--customer { background:linear-gradient(135deg,#0ea5e9,#10b981); }
.cai-cards { display:flex; flex-direction:column; gap:.4rem; margin:.1rem 0 .5rem; }
.cai-card { display:block; padding:.5rem .65rem; border:1px solid var(--border); border-radius:10px; background:#fff; text-decoration:none; transition:border-color .12s, box-shadow .12s; }
.cai-card:hover { border-color:#10b981; box-shadow:0 2px 10px rgba(16,185,129,.18); }
.cai-card__title { display:block; font-weight:600; color:var(--secondary); font-size:.85rem; }
.cai-card__meta { display:block; font-size:.78rem; color:var(--text-muted); margin-top:.15rem; }
.cai-card__meta b { color:var(--primary); }
.cai-quota { padding:.35rem .9rem; font-size:.72rem; color:var(--text-muted); border-top:1px solid var(--border); background:#fafafa; }
.ai-search-btn { display:inline-flex; align-items:center; gap:.3rem; background:linear-gradient(135deg,#0ea5e9,#10b981); color:#fff; border:none; border-radius:999px; padding:.35rem .7rem; font-size:.82rem; font-weight:600; cursor:pointer; }
.ai-search-btn:hover { filter:brightness(1.06); }
@media (max-width:640px){ .ai-search-btn__label { display:none; } }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-top: 1rem; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); text-align: center; }
.stat-card--alert { border-top: 3px solid var(--primary); }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--secondary); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Log table ──────────────────────────────── */
.log-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.log-table th { background: var(--bg); padding: 0.5rem; text-align: left; border-bottom: 2px solid var(--border); }
.log-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.log-row--warning td { background: #fffbeb; }
.log-row--error td, .log-row--critical td { background: #fef2f2; }
.log-badge { padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; }
.log-badge--warning { background: #fef3c7; color: #92400e; }
.log-badge--error, .log-badge--critical { background: #fee2e2; color: #991b1b; }
.log-badge--information { background: #dbeafe; color: #1e40af; }
.log-msg { max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-exception pre { font-size: 0.75rem; background: #fef2f2; padding: 0.5rem; border-radius: 4px; overflow: auto; max-height: 150px; }
.log-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.log-filters input, .log-filters select { padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; }

/* ── Footer ─────────────────────────────────── */
.portal-footer { background: var(--secondary); color: rgba(255,255,255,0.7); padding: 1rem 1.5rem; text-align: center; font-size: 0.85rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1280px; margin: 0 auto; flex-wrap: wrap; gap: 0.5rem; }
.portal-footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
.portal-footer a:hover { color: #fff; }

/* ── Utilities ──────────────────────────────── */
/* ── Admin shared ───────────────────────────── */
.admin-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.admin-page-header h1 { font-size: 1.4rem; color: var(--secondary); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th { background: var(--bg); padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:hover { background: #fafafa; }
/* Categories table: keep each parent row visually attached to its sub-category band
   (the lone "+ Sub" row was leaving a tall empty gap under every category). */
.admin-table--cats tr.cat-row > td { border-bottom: none; padding-bottom: 0.3rem; }
.admin-table--cats tr.subcat-row > td { border-top: none; padding-top: 0; padding-bottom: 0.55rem; }
.admin-table--cats tr.subcat-row .subcat-bar { margin-bottom: 0; }
.admin-table--cats tr.subcat-row:hover { background: transparent; }
.col-order { width: 60px; text-align: center; color: var(--text-muted); }
.col-actions { width: 1%; }
/* Action buttons: stacked, all equal width (= widest), equal height, single line each. */
.col-actions .btn-actions { display: flex; flex-direction: column; align-items: stretch; gap: 0.35rem; min-width: 130px; }
.col-actions .btn-actions > a,
.col-actions .btn-actions > button {
    box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
    width: 100%; min-height: 30px; margin: 0;
    white-space: nowrap;
}
/* fallback for cells without a .btn-actions wrapper: wrap instead of overflowing */
.col-actions > a, .col-actions > button { margin: 0.12rem 0.18rem 0.12rem 0; }
.section-thumb { width: 48px; height: 32px; object-fit: cover; border-radius: 4px; }
.img-preview-wrap { position: relative; display: inline-block; margin-bottom: .5rem; }
.img-preview { width: 120px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.img-remove-btn { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #e53e3e; color: #fff; border: none; cursor: pointer; font-size: .7rem; line-height: 1; display: grid; place-items: center; }
.upload-row { display: flex; align-items: center; gap: .5rem; margin-top: .25rem; }
.upload-label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.btn-danger { background: var(--danger); color: #fff; border: none; padding: 0.5rem 1.2rem; border-radius: var(--radius); cursor: pointer; font-weight: 600; display: inline-block; text-decoration: none; }
.btn-danger:hover { background: var(--danger-dark); }
/* Teal affirmative button (e.g. "Подтвердить" / "ДА") — distinct from the red destructive .btn-danger */
.btn-confirm { background: var(--primary); color: #fff; border: none; padding: 0.5rem 1.2rem; border-radius: var(--radius); cursor: pointer; font-weight: 600; display: inline-block; text-decoration: none; }
.btn-confirm:hover { background: var(--primary-dark); }
.btn-confirm:disabled:hover { background: var(--primary); }
/* Size modifiers come last so they win over color buttons' padding (e.g. .btn-danger.btn-xs) */
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.btn-xs { padding: 0.2rem 0.55rem; font-size: 0.78rem; }
.toggle-btn { border: none; padding: 0.25rem 0.6rem; border-radius: 12px; cursor: pointer; font-size: 0.8rem; font-weight: 600; }
.toggle-on { background: #d4edda; color: #155724; }
.toggle-off { background: #f8d7da; color: #721c24; }
.toggle-on:hover { background: #c3e6cb; }
.toggle-off:hover { background: #f5c6cb; }
.text-muted { color: var(--text-muted); }
.optional { color: var(--text-muted); font-size: 0.8rem; font-weight: 400; }
/* ── Modal ──────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 500;
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto; padding: 1rem 0.5rem; }
.modal-card { background: #fff; border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 480px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18); margin: auto; flex-shrink: 0; position: relative; }
.modal-close { position: absolute; top: .75rem; right: .75rem; background: none; border: none;
  cursor: pointer; font-size: 1.1rem; line-height: 1; padding: .3rem .45rem; border-radius: 6px;
  color: var(--text-muted); transition: background .15s, color .15s; }
.modal-close:hover { background: var(--surface); color: var(--secondary); }
.modal-card--sm { max-width: 360px; }
.modal-card--wide { max-width: 660px; }
.modal-card h2 { margin-bottom: 1.25rem; color: var(--secondary); font-size: 1.2rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input { width: auto; }
/* ── Alert ──────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.loading { text-align: center; padding: 2rem; color: var(--text-muted); }
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1rem; }
.page-container { max-width: 900px; margin: 2rem auto; padding: 0 1.5rem; }
.page-container h1 { font-size: 1.6rem; margin-bottom: 1.5rem; color: var(--secondary); }
.back-link { color: var(--text-muted); text-decoration: none; font-size: 0.88rem; display: inline-block; margin-bottom: 1rem; }
.back-link:hover { color: var(--secondary); }
/* ── Offer Detail ───────────────────────────── */
.offer-detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; align-items: start; }
.offer-detail-main { min-width: 0; }
.offer-gallery__main { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius); }
.offer-gallery__thumbs { display: flex; gap: .5rem; margin-top: .5rem; }
.offer-gallery__thumb { width: 72px; height: 52px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: 0.65; }
.offer-gallery__thumb.active { opacity: 1; outline: 2px solid var(--primary); }
.offer-detail-info { margin-top: 1.5rem; }
.offer-detail-info h1 { font-size: 1.6rem; color: var(--secondary); margin-bottom: .25rem; }
.offer-org { color: var(--text-muted); font-size: 0.88rem; margin-bottom: .75rem; }
.offer-description { line-height: 1.6; color: var(--text); }
.offer-meta-row { display: flex; gap: 1.25rem; margin-top: .75rem; font-size: 0.88rem; color: var(--text-muted); }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 20px; font-size: .75rem; font-weight: 700; margin-bottom: .5rem; margin-right: .25rem; }
.badge-featured { background: #fff3cd; color: #856404; }
.badge-blitz { background: #fff3cd; color: #856404; }
.offer-reviews { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.offer-reviews h2 { font-size: 1.2rem; margin-bottom: 1rem; }
.review-item { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.review-stars { color: #f59e0b; font-size: 1.1rem; margin-bottom: .25rem; }
/* ── Price box ──────────────────────────────── */
.price-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; position: sticky; top: 90px; }
.price-box__price { margin-bottom: 1rem; }
.price-amount { font-size: 1.8rem; font-weight: 800; color: var(--secondary); }
.price-unit { font-size: 0.9rem; color: var(--text-muted); margin-left: .25rem; }
.price-box__discount { color: var(--primary); font-weight: 700; margin-bottom: .5rem; }
.price-box__note { font-size: .78rem; color: var(--text-muted); margin-top: .75rem; text-align: center; }
.btn-full { width: 100%; text-align: center; }
/* ── Checkbox row (offer options) ───────────── */
.check-row { display: flex; align-items: center; gap: .55rem; font-weight: 400; cursor: pointer; padding: .25rem 0; }
.check-row input[type="checkbox"] { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; cursor: pointer; accent-color: var(--primary); }
/* ── Contact box (offer detail sidebar) ─────── */
.contact-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.5rem; margin-top: 1rem; }
.contact-box__title { font-size: 1rem; margin: 0 0 .5rem; color: var(--secondary); }
.contact-box__org { font-weight: 700; margin: 0 0 .6rem; }
.contact-box__line { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; color: var(--text); text-decoration: none; font-size: .9rem; word-break: break-all; }
.contact-box__line:hover { color: var(--primary); }
.contact-box .btn-full { margin-top: .75rem; }
.contact-box__head { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.contact-box__logo { width: 48px; height: 48px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex: 0 0 auto; }
.contact-box__head .contact-box__org { margin: 0; }
.contact-box__slogan { margin: .1rem 0 0; font-size: .82rem; color: var(--secondary); font-style: italic; }
.contact-box__about { margin: .75rem 0 0; padding-top: .75rem; border-top: 1px solid var(--border); font-size: .88rem; color: var(--text); line-height: 1.5; white-space: pre-line; }
/* ── Org profile logo edit ──────────────────── */
.logo-edit { display: flex; align-items: center; gap: 1rem; }
.logo-edit__preview { width: 72px; height: 72px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex: 0 0 auto; }
/* ── Order detail ───────────────────────────── */
.order-detail-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.order-detail-header h1 { font-size: 1.4rem; color: var(--secondary); }
.order-status-badge { padding: .25rem .75rem; border-radius: 20px; font-size: .82rem; font-weight: 600; }
.order-status-pending { background: #fff3cd; color: #856404; }
.order-status-confirmed { background: #d4edda; color: #155724; }
.order-status-awaiting { background: #ffe5b4; color: #8a5300; }
.order-status-paid { background: #d4edda; color: #155724; }
.order-status-cancelled { background: #f8d7da; color: #721c24; }
.order-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.order-detail-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.order-detail-card h3 { font-size: .9rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: .75rem; }
.order-detail-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
/* ── Review form ────────────────────────────── */
.review-form { background: var(--surface); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.star-picker { display: flex; align-items: center; gap: .25rem; margin-top: .25rem; }
.star-btn { background: none; border: none; font-size: 2rem; cursor: pointer; color: #d1d5db; transition: color .15s; padding: 0; }
.star-btn.star-active { color: #f59e0b; }
.star-btn:hover { color: #f59e0b; }
.star-label { margin-left: .5rem; font-size: .9rem; color: var(--text-muted); }
/* ── Offer status badges ────────────────────── */
.offer-status-badge { display: inline-block; padding: .2rem .6rem; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.offer-status-active { background: #d4edda; color: #155724; }
.offer-status-awaiting { background: #ffe5b4; color: #8a5300; }
.offer-status-draft { background: #e2e3e5; color: #383d41; }
.offer-status-pendingreview { background: #fff3cd; color: #856404; }
.offer-status-rejected { background: #f8d7da; color: #721c24; }
.offer-status-archived { background: #e2e3e5; color: #6c757d; }
.offer-status-expired { background: #f3e5f5; color: #8e24aa; }
.offer-status-paused { background: #fff8e1; color: #b8860b; }
/* ── Org Dashboard / listing ────────────────── */
.listing-layout { display: grid; grid-template-columns: 220px 1fr 280px; gap: 1.75rem; max-width: 1560px; margin: 1.5rem auto; padding: 0 1.5rem; align-items: start; }
.filter-panel { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.filter-panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--secondary); }
.filter-field { margin-bottom: .75rem; }
.filter-field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .25rem; color: var(--text-muted); }
.price-range-inputs { display: flex; align-items: center; gap: .4rem; }
.price-range-inputs .form-control { padding: .35rem .5rem; }
.price-range-sep { color: var(--text-muted); }
.filter-result-count { font-size: .82rem; font-weight: 700; color: var(--secondary); margin: 1rem 0 .5rem; }
.listing-main { min-width: 0; }
.listing-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.result-count { font-size: .88rem; color: var(--text-muted); }
.sort-select { padding: .3rem .6rem; border-radius: var(--radius); border: 1px solid var(--border); font-size: .88rem; }
.blitzdeal-sidebar { background: var(--surface); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); overflow: hidden; }
/* Keep the long word "Блицпредложения" inside the narrow sidebar box. */
.blitzdeal-sidebar h3 { display: flex; align-items: center; gap: .35rem; margin: 0 0 .6rem; font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
/* Richer, separated flash-deal cards in the category sidebar */
.blitz-list { display: flex; flex-direction: column; gap: .85rem; }
.blitz-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.06); transition: transform .15s, box-shadow .15s, border-color .15s; min-width: 0; }
.blitz-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.14); border-color: var(--accent); }
.blitz-card__media { position: relative; height: 110px; overflow: hidden; background: linear-gradient(135deg, #fff7e6, #ffe9b8); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.blitz-card__media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.blitz-card__ph { font-size: 2rem; opacity: .6; }
.blitz-card__disc { position: absolute; top: .4rem; left: .4rem; background: var(--primary); color: #fff; font-weight: 800; font-size: .8rem; padding: .15rem .5rem; border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.blitz-card__body { display: flex; flex-direction: column; gap: .3rem; padding: .6rem .7rem .7rem; min-width: 0; }
.blitz-card__title { font-size: .9rem; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.blitz-card__time { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; color: var(--accent); font-weight: 700; }
.blitz-card__foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .15rem; flex-wrap: wrap; }
.blitz-card__price { font-weight: 800; color: var(--secondary); font-size: .95rem; }
.blitz-card__unit { font-weight: 500; color: var(--text-muted); font-size: .72rem; }
.blitz-card__cta { font-size: .78rem; font-weight: 700; color: var(--primary); white-space: nowrap; }

/* Shared multi-photo upload preview grid (offer create/edit) */
.photo-grid { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .5rem; }
.photo-thumb { position: relative; width: 104px; height: 78px; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb__del { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: .8rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.photo-thumb__del:hover { background: #dc2626; }
.pagination { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1.5rem; }

/* ── Profile page ───────────────────────────── */
.profile-card { display:flex; align-items:center; gap:1.25rem; background:var(--surface); border-radius:var(--radius); padding:1.5rem; box-shadow:var(--shadow); margin-bottom:1.5rem; }
.profile-avatar-lg { width:64px; height:64px; border-radius:50%; background:var(--primary); color:#fff; font-size:1.6rem; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.profile-form { background:var(--surface); border-radius:var(--radius); padding:1.5rem; box-shadow:var(--shadow); margin-bottom:1.5rem; }
.profile-form h3 { font-size:1rem; color:var(--secondary); margin-bottom:1rem; }
.profile-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; background:var(--surface); border-radius:var(--radius); padding:1.25rem; box-shadow:var(--shadow); }
.profile-info-item { display:flex; flex-direction:column; gap:.25rem; }
.profile-info-label { font-size:.78rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.5px; }
/* ── Settings page ──────────────────────────── */
.settings-section { background:var(--surface); border-radius:var(--radius); padding:1.5rem; box-shadow:var(--shadow); margin-bottom:1.25rem; }
.settings-section h3 { font-size:1rem; color:var(--secondary); margin-bottom:1rem; }
.settings-section--danger { border:1px solid #f5c6cb; }
/* ── Activity feed ──────────────────────────── */
.activity-feed { display:flex; flex-direction:column; gap:.75rem; }
.activity-item { display:flex; align-items:center; gap:1rem; background:var(--surface); border-radius:var(--radius); padding:1rem 1.25rem; box-shadow:var(--shadow); }
.activity-item--unread { border-left:3px solid var(--primary); }
.activity-item--link { text-decoration:none; color:inherit; transition:box-shadow .15s; }
.activity-item--link:hover { box-shadow:0 2px 12px rgba(0,0,0,.12); }
.activity-icon { width:36px; height:36px; border-radius:50%; background:var(--bg); display:flex; align-items:center; justify-content:center; font-size:1rem; flex-shrink:0; }
.activity-icon--confirmed { background:#d4edda; }
.activity-icon--cancelled { background:#f8d7da; }
.activity-icon--pending { background:#fff3cd; }
.activity-body { flex:1; min-width:0; }
.activity-body p { margin:0; }
.activity-actions { display:flex; gap:.4rem; flex-wrap:wrap; margin-top:.5rem; }
/* Order row deep-linked from a notification / chat (?focus=…) */
.order-row-focus { background:#fff8e1; box-shadow:inset 3px 0 0 var(--primary); transition:background .4s; }
.chat-related-order { margin-bottom:1rem; }

/* Collapsible 💬 message + chat chip in the org order inbox */
.order-chat { margin-top:.35rem; }
.msg-chip { display:inline-flex; align-items:center; gap:.3rem; font-size:.8rem; padding:.15rem .55rem;
    border:1px solid var(--border, #dee2e6); border-radius:999px; background:var(--bg, #f1f3f5);
    color:var(--text-muted); cursor:pointer; line-height:1.4; }
.msg-chip:hover { background:#e9ecef; }
.msg-chip__count { font-weight:600; color:var(--secondary); }
.msg-chip__caret { font-size:.6rem; }
.order-chat-expand { margin-top:.4rem; padding:.5rem .65rem; background:var(--bg, #f1f3f5);
    border-radius:var(--radius); max-width:320px; }
.order-chat-msg { margin:0 0 .5rem; font-size:.85rem; white-space:pre-wrap; }
/* ── Chat list ──────────────────────────────── */
.chat-list { display:flex; flex-direction:column; gap:.75rem; }
.chat-session-card { background:var(--surface); border-radius:var(--radius); padding:1rem 1.25rem; box-shadow:var(--shadow); cursor:pointer; display:flex; justify-content:space-between; align-items:center; }
.chat-session-card:hover { background:#f8f9fa; }
.chat-session-card--unread { border-left:3px solid var(--primary); background:#f5f9ff; }
.chat-session-card--unread strong { font-weight:700; }
.chat-unread-pill { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px;
    padding:0 6px; margin-right:.5rem; border-radius:999px; background:#e03131; color:#fff;
    font-size:.72rem; font-weight:700; line-height:1; }
.chat-status-dot { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:.5rem;
    flex-shrink:0; background:#adb5bd; }
.chat-status-dot--open, .chat-status-dot--forwarded { background:#2f9e44; }
.chat-status-dot--closed { background:#adb5bd; }
.chat-session-info { display:flex; align-items:center; }

/* ── Chat conversation ──────────────────────── */
.chat-conversation { max-width: 720px; }
.chat-back-link { display:inline-block; font-size:.85rem; color:var(--text-muted); margin-bottom:.75rem; }
.chat-title { font-size:1.25rem; margin-bottom:1rem; color:var(--secondary); }
.chat-thread { display:flex; flex-direction:column; gap:.5rem; min-height:320px; max-height:60vh; overflow-y:auto; padding:1rem; background:#f1f3f5; border-radius:var(--radius); margin-bottom:1rem; }
.chat-empty-thread { text-align:center; margin:auto; }
.chat-bubble-row { display:flex; }
.chat-bubble-row.mine { justify-content:flex-end; }
.chat-bubble-row.theirs { justify-content:flex-start; }
.chat-bubble { max-width:75%; padding:.5rem .75rem; border-radius:14px; background:var(--surface); box-shadow:var(--shadow); display:flex; flex-direction:column; gap:.15rem; }
.chat-bubble-row.mine .chat-bubble { background:var(--primary); color:#fff; }
.chat-bubble-sender { font-size:.72rem; font-weight:700; color:var(--primary); }
.chat-bubble-body { font-size:.92rem; white-space:pre-wrap; word-break:break-word; }
.chat-bubble-time { font-size:.68rem; opacity:.7; align-self:flex-end; }
.chat-suggest-bar { display:flex; justify-content:flex-end; margin-bottom:.4rem; }
.chat-suggest-btn { font-size:.85rem; }
.chat-composer { display:flex; gap:.5rem; align-items:flex-end; }
.chat-composer .form-control { flex:1; }
.chat-input { flex:1; resize:vertical; min-height:2.6rem; max-height:9rem; line-height:1.35;
    font-family:inherit; font-size:.95rem; overflow-y:auto; field-sizing:content; }
.chat-composer .btn-primary { flex:0 0 auto; align-self:stretch; }
.chat-closed-note { text-align:center; font-style:italic; }
.chat-attach-btn { display:flex; align-items:center; justify-content:center; padding:.5rem .6rem; cursor:pointer; flex:0 0 auto; align-self:stretch; font-size:1.1rem; }
.chat-attach-preview { display:flex; align-items:center; gap:.5rem; font-size:.85rem; color:var(--text-muted); margin-top:.25rem; padding:.25rem .5rem; background:var(--surface); border-radius:var(--radius); }
.chat-attach-thumb { max-height:60px; max-width:90px; border-radius:6px; object-fit:cover; }
.chat-bubble-attachment { margin-bottom:.25rem; }
.chat-attachment-img { max-width:180px; max-height:180px; border-radius:8px; cursor:pointer; object-fit:cover; }
/* ── Payment badges & panel ──────────────────────── */
.payment-badge { display:inline-block; font-size:.75rem; font-weight:600; padding:.2rem .55rem; border-radius:20px; }
.payment-badge--paid { background:#d4edda; color:#155724; }
.payment-badge--confirmed { background:#cce5ff; color:#004085; }
.order-payment-row { display:flex; flex-wrap:wrap; gap:.35rem; margin-bottom:.4rem; }
.payment-panel { position:relative; margin-top:.5rem; padding:.75rem; background:var(--surface); border-radius:var(--radius); border:1px solid var(--border); }
.payment-panel__close { position:absolute; top:.4rem; right:.4rem; width:1.5rem; height:1.5rem; line-height:1; padding:0; border:none; background:none; color:var(--text-muted); font-size:1.1rem; cursor:pointer; border-radius:4px; }
.payment-panel__close:hover { background:var(--border); color:var(--secondary); }
.chat-nav-link { position:relative; display:inline-block; }
.chat-unread-badge { position:absolute; top:-7px; right:-10px; min-width:17px; height:17px; padding:0 4px; box-sizing:border-box; background:#e3342f; color:#fff; font-size:.66rem; font-weight:700; line-height:17px; text-align:center; border-radius:9px; box-shadow:0 0 0 2px var(--primary); }

/* ── Create offer panel ─────────────────────── */
.btn-create-offer { background: linear-gradient(135deg,var(--primary),var(--primary-dark)); color:#fff; border:none; padding:.4rem 1rem; border-radius:20px; font-size:.85rem; font-weight:600; cursor:pointer; transition:opacity .2s; }
.btn-create-offer:hover { opacity:.88; }
.create-panel { background:var(--surface); border-radius:var(--radius); box-shadow:0 4px 20px rgba(0,0,0,0.12); margin-bottom:1.25rem; overflow:hidden; border:2px solid var(--primary); animation:slideDown .3s ease; }
@keyframes slideDown { from{opacity:0;transform:translateY(-12px)} to{opacity:1;transform:translateY(0)} }
.create-panel__header { background:linear-gradient(135deg,var(--primary),var(--primary-dark)); color:#fff; padding:1rem 1.25rem; display:flex; justify-content:space-between; align-items:center; }
.create-panel__header h3 { margin:0; font-size:1rem; }
.create-panel__header em { font-style:normal; opacity:.85; }
.create-step-badge { background:rgba(255,255,255,.2); padding:.2rem .6rem; border-radius:12px; font-size:.78rem; }
.create-panel__body { padding:1.25rem; }
.create-panel__footer { padding:.75rem 1.25rem 1.25rem; display:flex; gap:.75rem; justify-content:flex-end; border-top:1px solid var(--border); }
.btn-create-submit { background:#16a34a; color:#fff; border:none; padding:.5rem 1.25rem; border-radius:var(--radius); font-weight:600; cursor:pointer; font-size:.9rem; transition:background .2s; }
.btn-create-submit:hover { background:#15803d; }
.btn-create-submit:disabled { opacity:.6; cursor:default; }
/* Upload zone */
.upload-zone { border:2px dashed var(--border); border-radius:var(--radius); padding:2rem; text-align:center; cursor:pointer; position:relative; color:var(--text-muted); transition:border-color .2s; }
.upload-zone:hover { border-color:var(--primary); color:var(--primary); }
.upload-zone--loading { opacity:.6; pointer-events:none; }
.upload-zone .upload-icon { display:block; font-size:2rem; margin-bottom:.5rem; }
.upload-input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }
.upload-preview { max-height:160px; border-radius:6px; max-width:100%; }
/* NEW badge + animation */
.offer-new-wrapper { position:relative; animation:slideInNew .5s ease; }
@keyframes slideInNew { from{opacity:0;transform:translateX(-20px)} to{opacity:1;transform:translateX(0)} }
.badge-new { position:absolute; top:-8px; left:8px; background:linear-gradient(135deg,#16a34a,#15803d); color:#fff; font-size:.7rem; font-weight:700; padding:.2rem .55rem; border-radius:10px; z-index:2; letter-spacing:.5px; box-shadow:0 2px 6px rgba(22,163,74,.4); animation:pulse 2s ease infinite; }

/* Price badges on offer cards */
.badge-bestprice { align-self:flex-start; background:linear-gradient(135deg,#16a34a,#15803d); color:#fff; font-size:.72rem; font-weight:700; padding:.2rem .6rem; border-radius:10px; margin-bottom:.35rem; }
.badge-savings { align-self:flex-start; background:rgba(214,69,61,.12); color:#d6453d; font-size:.72rem; font-weight:700; padding:.2rem .6rem; border-radius:10px; margin-bottom:.35rem; }
/* ⭐ Top / promoted badge (sits in the stats row) */
.badge-top { background:rgba(245,158,11,.14); color:#b45309; font-weight:700; padding:.15rem .5rem; border-radius:10px; }

/* ── Badge info popovers (hover on desktop, tap = focus on touch) ──────────
   Any element with .badge-pop becomes the anchor for a .badge-pop__pop tooltip.
   tabindex makes a tap focus it so :focus-within reveals the popover on mobile. */
.badge-pop { position:relative; cursor:help; outline:none; }
.badge-pop__pop {
  position:absolute; bottom:calc(100% + 9px); left:0; z-index:60;
  min-width:170px; max-width:250px; width:max-content; padding:.55rem .65rem;
  background:#1f2937; color:#f3f4f6; border-radius:8px;
  font-size:.76rem; font-weight:500; line-height:1.45; text-align:left;
  white-space:normal; box-shadow:0 8px 26px rgba(0,0,0,.28);
  opacity:0; visibility:hidden; transform:translateY(4px); pointer-events:none;
  transition:opacity .15s ease, transform .15s ease, visibility .15s;
}
.badge-pop__pop::after { content:""; position:absolute; top:100%; left:18px; border:6px solid transparent; border-top-color:#1f2937; }
.badge-pop__pop--down { top:calc(100% + 9px); bottom:auto; }
.badge-pop__pop--down::after { top:auto; bottom:100%; border-top-color:transparent; border-bottom-color:#1f2937; }
.badge-pop__pop--right { left:auto; right:0; }
.badge-pop__pop--right::after { left:auto; right:18px; }
.badge-pop:hover > .badge-pop__pop,
.badge-pop:focus > .badge-pop__pop,
.badge-pop:focus-within > .badge-pop__pop { opacity:1; visibility:visible; transform:translateY(0); }
.badge-pop__title { display:block; font-weight:700; color:#fff; margin-bottom:.3rem; }
.badge-pop__row { display:flex; justify-content:space-between; gap:1rem; }
.badge-pop__row + .badge-pop__row { margin-top:.15rem; }
.badge-pop__row strong { color:#fff; }
.badge-pop__old { text-decoration:line-through; opacity:.7; }

/* ── Compare (checkbox · floating bar · modal table) ───────────────────── */
.offer-compare { display:inline-flex; align-items:center; gap:.4rem; font-size:.8rem; color:var(--text-muted); cursor:pointer; margin:.25rem 0; }
.offer-compare input { cursor:pointer; }
.compare-bar { position:fixed; left:50%; bottom:1rem; transform:translateX(-50%); z-index:480; display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; max-width:92vw; background:var(--surface); border:1px solid var(--border); box-shadow:0 6px 28px rgba(0,0,0,.2); border-radius:999px; padding:.5rem 1rem; }
.compare-bar__count { font-weight:700; color:var(--secondary); white-space:nowrap; }
.compare-bar__thumbs { display:flex; gap:.4rem; flex-wrap:wrap; }
.compare-chip { display:inline-flex; align-items:center; gap:.3rem; max-width:160px; background:var(--bg); border:1px solid var(--border); border-radius:999px; padding:.15rem .5rem; font-size:.78rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.compare-chip__x { background:none; border:none; cursor:pointer; color:var(--text-muted); font-size:.75rem; padding:0; }
.compare-chip__x:hover { color:var(--primary); }
.compare-modal { max-width:900px; }
.compare-table-wrap { overflow-x:auto; }
.compare-table { width:100%; border-collapse:collapse; }
.compare-table th, .compare-table td { border:1px solid var(--border); padding:.6rem .75rem; text-align:center; vertical-align:middle; font-size:.9rem; }
.compare-table td:first-child, .compare-table th:first-child { text-align:left; font-weight:600; color:var(--text-muted); background:var(--bg); white-space:nowrap; }
.compare-img { width:80px; height:60px; object-fit:cover; border-radius:6px; }
.compare-th-title { font-size:.85rem; font-weight:700; margin-top:.3rem; }
.compare-best { background:rgba(22,163,74,.08); }

/* ── Favorites page ────────────────────────────────────────────────────── */
.favorites-list { display:flex; flex-direction:column; gap:.75rem; }
.favorite-item { display:flex; align-items:center; justify-content:space-between; gap:1rem; background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow); padding:1rem 1.25rem; }
.favorite-item__info { display:flex; flex-direction:column; gap:.25rem; min-width:0; }
.favorite-item__title { font-weight:700; color:var(--secondary); text-decoration:none; }
.favorite-item__title:hover { text-decoration:underline; }
.favorite-item__price { font-size:.9rem; }
.favorite-item__actions { display:flex; gap:.5rem; flex-shrink:0; }
@keyframes pulse { 0%,100%{box-shadow:0 2px 6px rgba(22,163,74,.4)} 50%{box-shadow:0 2px 12px rgba(22,163,74,.7)} }

/* ── Mobile header (PWA / phone) ──────────────────────────────────────
   Compact top row (logo + icons), full-width search on its own row.    */
@media (max-width: 640px) {
    .header-inner { flex-wrap: wrap; padding: 0.55rem 0.85rem; gap: 0.5rem 0.6rem; }
    .portal-logo { font-size: 1.25rem; }

    /* Search drops to its own full-width line below the logo/icons. */
    .header-search { order: 3; flex: 1 0 100%; }
    .global-search { padding: 0.55rem 1rem; font-size: 0.95rem; }

    /* Icon row stays compact and pinned right. */
    .header-nav { margin-left: auto; gap: 0.55rem; }
    .header-nav a { font-size: 1.15rem; }

    /* Language lives in the profile menu / settings on phones; the email
       label is dropped so only the avatar shows. */
    .lang-switcher { display: none; }
    .profile-name, .profile-caret { display: none; }
    .profile-trigger { padding: 0.25rem; gap: 0; background: transparent; }

    .category-bar { padding-left: 0.25rem; }
}

/* ── Mobile content layouts (PWA / phone) ─────────────────────────────
   Collapse multi-column page layouts to a single column on phones.     */
@media (max-width: 640px) {
    /* Offer detail: stack the price/contact box under the main content
       instead of a side column that overlaps on narrow screens. */
    .offer-detail-layout { grid-template-columns: 1fr; gap: 1.25rem; margin: 1rem auto; padding: 0 1rem; }
    .price-box { position: static; top: auto; }

    /* Forms: stack paired fields (price + unit, etc.) so each gets full width
       instead of two cramped half-width inputs on a phone. */
    .form-row { grid-template-columns: 1fr; gap: 0; }

    /* Listing offer card: a single vertical card (header → stats → price/CTA)
       instead of the desktop two-column compare layout. */
    .listing-main .offer-card { grid-template-columns: 1fr; column-gap: 0; align-items: start; padding: 1.1rem 1.2rem; }
    .listing-main .offer-card__header,
    .listing-main .offer-card__stats,
    .listing-main .offer-card__footer { grid-column: 1; }
    .listing-main .offer-card__header { align-items: flex-start; }
    .listing-main .offer-card__image { width: 84px; height: 64px; }
    .listing-main .offer-card__footer { flex-direction: row; align-items: center; justify-content: space-between;
        border-left: none; border-top: 1px solid var(--border); padding: 0.85rem 0 0; }

    /* Listing wrapper: drop side padding so cards use full width. */
    .listing-layout { padding: 0 0.85rem; margin: 1rem auto; }

    /* Hero: tighter padding on phones. */
    .hero { padding: 1.75rem 1rem; }
    .portal-main { padding: 1rem; }

    /* Page headers (title + action buttons): let the actions drop below the
       title and wrap, instead of a non-wrapping row that runs off-screen. */
    .admin-page-header { flex-wrap: wrap; gap: 0.6rem; align-items: flex-start; }
    .admin-page-header > div { flex-wrap: wrap; }

    /* Blitz-deal hero carousel: on desktop it lays 3 cards (min-width 260px each)
       side by side, which overflows a phone screen and forces the whole PAGE to
       scroll sideways. On mobile let the cards swipe horizontally INSIDE the track
       (scroll-snap, one card ~full width) instead, and drop the arrow buttons. */
    .blitz-carousel-btn { display: none; }
    .blitz-carousel-track { justify-content: flex-start; max-width: 100%; gap: 0.6rem;
        overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory;
        padding-bottom: 0.25rem; }
    .blitz-carousel-track .hero-blitzdeal { flex: 0 0 88%; min-width: 0; max-width: 88%;
        scroll-snap-align: center; padding: 1rem 1.1rem; }
}

/* ── Admin shell on phones ────────────────────────────────────────────
   The desktop admin is a fixed 250px sidebar + content grid. On a phone the
   sidebar crushes the content into an unusable sliver, so collapse the layout
   to a single column and turn the sidebar into a horizontal scrollable strip
   of nav chips above the content.                                       */
@media (max-width: 768px) {
    .portal-header--admin, .portal-main--admin { max-width: 100%; }
    .admin-layout { grid-template-columns: 1fr; min-height: 0; }
    /* Contain any wide table (e.g. the orgs list, which has no scroll wrapper
       because of its owner popover) inside the content column so it scrolls
       here instead of dragging the whole page sideways. */
    .admin-main { padding: 1rem; overflow-x: auto; }

    .admin-sidebar { flex-direction: row; align-items: stretch; gap: 0.4rem;
        padding: 0.5rem 0.6rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .admin-sidebar__brand,
    .admin-sidebar .sidebar-section-label,
    .admin-sidebar__footer { display: none; }
    .admin-sidebar ul { display: flex; flex-direction: row; gap: 0.4rem; flex: 0 0 auto; }
    .admin-sidebar ul li { flex: 0 0 auto; }
    .admin-sidebar ul li a, .admin-sidebar ul li .active { white-space: nowrap;
        margin-bottom: 0; padding: 0.5rem 0.7rem; }
    .admin-sidebar ul li a .nav-label { overflow: visible; }
}

/* ── Subscription plans (admin) ──────────────────────────────────────────── */
.admin-card { background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.plan-editor h3 { margin: 0 0 .9rem; font-size: 1.05rem; color: var(--secondary); }
.plan-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem 1rem; align-items: end; }
.plan-form-grid label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem;
    color: var(--text-muted, #555); font-weight: 600; }
.plan-form-grid label.chk { flex-direction: row; align-items: center; gap: .45rem; font-weight: 500; }
.plan-form-grid input[type=color] { height: 38px; padding: 2px; }
.plan-form-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.plan-pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; color: #fff;
    font-size: .8rem; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.row-inactive { opacity: .55; }

/* Plan badge in the org list + traffic-light validity dot */
.sub-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem;
    border-radius: 999px; color: #fff; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.sub-valid { font-size: .72rem; color: var(--text-muted, #666); white-space: nowrap; }
.sub-valid .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .25rem; }
.sub-valid .dot.green { background: #16a34a; }
.sub-valid .dot.amber { background: #d97706; }
.sub-valid .dot.red   { background: #dc2626; }

/* Org cabinet plan card */
.sub-card { background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.sub-card__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    flex-wrap: wrap; margin-bottom: .9rem; }
.sub-card__title { font-weight: 700; color: var(--secondary); }
.sub-meter { margin: .55rem 0; }
.sub-meter__label { display: flex; justify-content: space-between; font-size: .82rem;
    color: var(--text-muted, #555); margin-bottom: .25rem; }
.sub-meter__bar { height: 8px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.sub-meter__fill { height: 100%; border-radius: 999px; background: var(--primary, #2563eb); transition: width .3s; }
.sub-meter__fill.warn { background: #d97706; }
.sub-meter__fill.full { background: #dc2626; }
.sub-feats { display: flex; flex-wrap: wrap; gap: .4rem .8rem; font-size: .82rem; margin-top: .6rem; }
.sub-feats span { white-space: nowrap; }
.sub-reserve { margin-top:.5rem; font-size:.8rem; color:var(--text-muted); display:flex; align-items:center; }
.sub-feats span.on { color: #16a34a; }
.sub-feats span.off { color: #9ca3af; }

/* Read-only tariff summary strip (org profile page) */
.profile-plan-strip { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 14px; margin-bottom: 18px; }
.profile-plan-strip .sub-feats { margin-top: 0; }
.profile-plan-strip__link { margin-left: auto; font-size: .85rem; white-space: nowrap; }

/* Self-service tier upgrade (org dashboard) */
.sub-upgrade { margin-top: .8rem; padding-top: .7rem; border-top: 1px dashed var(--border); }
.sub-upgrade__pending { font-size: .85rem; color: #b45309; background: #fffbeb;
    border: 1px solid #fde68a; border-radius: 8px; padding: .5rem .75rem; }
.sub-upgrade__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.sub-plan-opt { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    padding: .45rem 0; border-bottom: 1px solid #f1f5f9; }
.sub-plan-opt:last-child { border-bottom: 0; }
.sub-plan-opt__info { font-size: .82rem; color: var(--secondary); flex: 1 1 auto; }

/* Consultation / analysis widget (org dashboard) */
.consult-card textarea { width: 100%; resize: vertical; }
.consult-answer { margin-top: .8rem; padding: .8rem 1rem; background: #f8fafc; border: 1px solid var(--border);
    border-left: 3px solid #7c3aed; border-radius: 8px; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; }

/* ── Admin AI copilot ─────────────────────────────────────────── */
.ai-fab--admin { background: var(--primary); color: #fff; font-size: 1.4rem; }
.ai-fab--admin:hover { background: var(--primary-dark); }
.ai-chat--admin .ai-chat__head { background: #075f50; }
.copilot-quick { display: flex; flex-direction: column; gap: .4rem; margin: .6rem 0; }
.copilot-quick__btn { text-align: left; background: #eef4fb; border: 1px solid #cfe0f3; color: #1d4e89; border-radius: 8px; padding: .45rem .6rem; cursor: pointer; font-size: .85rem; }
.copilot-quick__btn:hover { background: #e0ecfa; }
.copilot-cards { display: flex; flex-direction: column; gap: .5rem; margin: .3rem 0 .6rem; }
.copilot-card { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; background: #fff; }
.copilot-card__title { font-weight: 600; font-size: .9rem; }
.copilot-card__sub { color: var(--text-muted); font-size: .82rem; margin-top: .15rem; }
.copilot-card__actions { display: flex; gap: .4rem; align-items: center; margin-top: .5rem; flex-wrap: wrap; }
.copilot-done { color: #166534; font-weight: 600; font-size: .82rem; }
.copilot-err { color: #991b1b; font-weight: 600; font-size: .82rem; }

/* ── AI-autonomy config card ──────────────────────────────────── */
.cfg-autonomy { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.cfg-autonomy h2 { font-size: 1.05rem; margin-bottom: .25rem; }
.cfg-autonomy > .text-muted { font-size: .85rem; margin-bottom: .8rem; }
.autonomy-row { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; font-size: .92rem; }

/* ── Dynamic order form ───────────────────────────────────────── */
.dynamic-form-group { margin-bottom: 1.1rem; padding: .75rem .85rem; background: #f9fafb; border: 1px solid var(--border); border-radius: 10px; }
.dynamic-form-group__title { font-size: .95rem; font-weight: 600; color: var(--primary); margin: 0 0 .6rem; }
.dynamic-form-fields { display: flex; flex-direction: column; gap: .5rem; }
.dynamic-form-repeater-row { border-bottom: 1px solid var(--border); padding-bottom: .6rem; margin-bottom: .6rem; }
.dynamic-form-repeater-row:last-child { border-bottom: none; margin-bottom: 0; }
.dynamic-form-repeater-row__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.dynamic-form-repeater-row__label { font-size: .82rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.form-control--num { max-width: 9rem; }
.dynamic-form-repeater__remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .85rem; line-height: 1; padding: .2rem .4rem; border-radius: 6px; }
.dynamic-form-repeater__remove:hover { background: #fee2e2; color: #dc2626; }
.dynamic-form-repeater__add { margin-top: .4rem; background: #fff; border: 1px dashed var(--border); color: var(--primary); border-radius: 8px; padding: .4rem .75rem; cursor: pointer; font-size: .85rem; font-weight: 600; }
.dynamic-form-repeater__add:hover { background: #f0fdfa; border-color: var(--primary); }
.ai-fill { margin-bottom: 1rem; }
.ai-fill__toggle { width: 100%; background: #f0fdfa; border: 1px dashed var(--primary); color: var(--primary); border-radius: 8px; padding: .55rem .8rem; cursor: pointer; font-weight: 600; font-size: .9rem; }
.ai-fill__toggle:hover { background: #e6fbf8; }
.ai-fill__panel { border: 1px dashed var(--primary); border-radius: 10px; padding: .75rem .85rem; background: #f7fffe; }
.ai-fill__hint { font-size: .82rem; color: var(--text-muted); margin: 0 0 .5rem; }
.ai-fill__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .55rem; }
.order-freetext-note { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; padding: .6rem .75rem; background: #f0fdfa; border: 1px dashed var(--primary); border-radius: 10px; font-size: .85rem; color: var(--text); }
.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-size: .82rem; font-weight: 600; padding: 0; text-decoration: underline; }
.doc-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.doc-list__item { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .85rem; background: #f9fafb; border: 1px solid var(--border); border-radius: 8px; padding: .35rem .55rem; }
.doc-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .25rem; }
.doc-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; background: #f0fdfa; border: 1px solid var(--border); border-radius: 8px; padding: .3rem .55rem; text-decoration: none; color: var(--primary); }
.doc-link:hover { border-color: var(--primary); }
.locked-fields { background: #f9fafb; border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; margin-bottom: .7rem; }
.locked-fields__head { font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: .45rem; }
.locked-fields__group { margin-bottom: .35rem; }
.locked-fields__gtitle { display: block; font-size: .78rem; font-weight: 600; color: var(--primary); margin-bottom: .25rem; }
.locked-chip { display: inline-block; font-size: .8rem; color: #475569; background: #eef2f7; border: 1px solid var(--border); border-radius: 999px; padding: .15rem .5rem; margin: 0 .3rem .3rem 0; }
.base-field-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .82rem; padding: .2rem 0; }
.base-field-row__label { color: #475569; }
.base-field-row--removed .base-field-row__label { text-decoration: line-through; color: var(--text-muted); opacity: .7; }
.custom-field-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .4rem; }
.custom-field-row .cf-label { flex: 1 1 12rem; }
.custom-field-row .cf-type { flex: 0 0 9rem; }
.cf-req { display: inline-flex; align-items: center; gap: .25rem; font-size: .82rem; color: var(--text-muted); white-space: nowrap; }
.cf-options { margin: 0 0 .5rem; }
.ofd { display: flex; flex-direction: column; gap: .5rem; }
.ofd-group { background: #f9fafb; border: 1px solid var(--border); border-radius: 8px; padding: .5rem .6rem; }
.ofd-group__title { font-size: .82rem; font-weight: 600; color: var(--primary); margin-bottom: .35rem; }
.ofd-item { border-top: 1px dashed var(--border); padding-top: .35rem; margin-top: .35rem; }
.ofd-item:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.ofd-item__label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin-bottom: .2rem; }
.ofd-kv { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .6rem; margin: 0; }
.ofd-kv dt { font-size: .82rem; color: var(--text-muted); }
.ofd-kv dd { font-size: .85rem; margin: 0; }
.schema-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.45; white-space: pre; tab-size: 2; }
.reg-type { display: flex; gap: .5rem; }
.reg-type__opt { flex: 1; display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .55rem .6rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: .9rem; background: #fff; }
.reg-type__opt input { margin: 0; }
.reg-type__opt--active { border-color: var(--primary); background: #f0fdfa; font-weight: 600; color: var(--primary); }
