:root{
  --page:#f5f7fb;
  --panel:#ffffff;
  --ink:#111827;
  --muted:#64748b;
  --line:#e5eaf2;
  --brand:#2563eb;
  --brand-strong:#1d4ed8;
  --good:#16a34a;
  --warn:#d97706;
  --bad:#dc2626;
  --soft-blue:#eef5ff;
  --shadow:0 18px 45px rgba(15,23,42,.08);
}
*{box-sizing:border-box}
body{font-family:Inter,"Segoe UI","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji",Arial,"Microsoft YaHei",sans-serif;background:var(--page);color:var(--ink);letter-spacing:0}
a{text-decoration:none}.text-break{word-break:break-word}
.card{border:1px solid var(--line);border-radius:14px;box-shadow:none}.card-header{border-bottom-color:var(--line);border-top-left-radius:14px!important;border-top-right-radius:14px!important}.card-body{padding:1.25rem}.form-control,.form-select,.btn{border-radius:10px}.table>thead th{font-weight:700;color:#475569;white-space:nowrap;background:#f8fafc}.table td{vertical-align:middle}

.public-home{background:linear-gradient(180deg,#f7fbff 0,#f4f7fb 42%,#ffffff 100%)}
.site-shell{max-width:1180px;margin:0 auto;padding:24px 20px 0}.site-nav{height:64px;display:flex;align-items:center;justify-content:space-between;gap:16px}.brand-mark{display:inline-flex;align-items:center;gap:12px;color:var(--ink)}.brand-mark span{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--brand);color:#fff;font-weight:800}.brand-mark strong{font-size:18px}.nav-actions{display:flex;align-items:center;gap:10px}.nav-actions a{color:#475569;font-weight:700;font-size:14px;padding:9px 12px;border-radius:999px}.nav-actions a:hover{background:#eaf1ff;color:var(--brand-strong)}.admin-link{border:1px solid var(--line);background:#fff}
.hero-panel{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(360px,.9fr);gap:20px;align-items:center;min-height:0;padding:18px 0 16px;overflow:hidden}.hero-copy{padding:0}.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:12px;font-weight:800;color:var(--brand);margin:0 0 12px}.hero-copy h1{font-size:32px;line-height:1.12;margin:0 0 8px;font-weight:850;color:#0f172a}.hero-copy p{font-size:14px;line-height:1.5;color:#475569;max-width:720px;margin:0 0 10px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.hero-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;color:#64748b;font-size:13px}.primary-action{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 14px;border-radius:10px;background:var(--brand);color:#fff;font-weight:800;box-shadow:0 8px 18px rgba(37,99,235,.18)}.primary-action:hover{background:var(--brand-strong);color:#fff}
.status-board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-content:center}.status-card{min-height:86px;padding:14px;border-radius:14px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);position:relative;overflow:hidden}.status-card:before{content:"";position:absolute;inset:0 0 auto;height:5px;background:#cbd5e1}.status-card span{display:block;color:#64748b;font-weight:800;font-size:13px;text-transform:uppercase;letter-spacing:.08em}.status-card strong{display:block;margin-top:10px;font-size:30px;line-height:1;font-weight:850}.status-card small{display:none}.status-card.good:before{background:var(--good)}.status-card.muted:before{background:#94a3b8}.status-card.bad:before{background:var(--bad)}.status-card.total:before{background:var(--brand)}
.content-shell{max-width:1180px;margin:0 auto;padding:18px 20px 46px}.section-heading{display:flex;align-items:end;justify-content:space-between;gap:24px;margin-bottom:18px}.section-heading h2{font-size:30px;margin:0;font-weight:850}.section-heading>p{max-width:560px;margin:0;color:#64748b;line-height:1.6}.section-heading code{background:#eef2ff;color:#1d4ed8;border-radius:6px;padding:2px 6px}.inventory-card{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);overflow:hidden}.inventory-table{margin:0}.inventory-table th{padding:10px 14px}.inventory-table td{padding:10px 14px;border-color:#eef2f7}.product-name{font-weight:800;color:#0f172a}.product-title-row{display:flex;align-items:center;gap:8px;min-width:0;flex-wrap:wrap}.product-stock-pill{display:inline-flex;flex:0 0 auto;min-height:22px;padding:0 7px;font-size:11px;line-height:22px;border-radius:999px;white-space:nowrap}.product-meta,.checked-at{font-size:12px;color:#94a3b8;margin-top:2px}.stock-pill{display:inline-flex;align-items:center;min-height:26px;padding:0 9px;border-radius:999px;font-size:12px;font-weight:800}.stock-in_stock{background:#dcfce7;color:#15803d}.stock-out_of_stock{background:#fee2e2;color:#b91c1c}.stock-unknown{background:#f1f5f9;color:#475569}.row-action{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:0 10px;border-radius:9px;background:#eef5ff;color:#1d4ed8;font-weight:800}.row-action:hover{background:#dbeafe;color:#1e40af}.empty-state{text-align:center;padding:70px 22px}.empty-state h3{font-size:24px;font-weight:850}.empty-state p{color:#64748b;margin:8px 0 0}.site-footer{max-width:1180px;margin:0 auto;padding:24px 20px 42px;color:#64748b;font-size:14px}

.navbar-brand{letter-spacing:.1px}.stat-card{min-height:124px;overflow:hidden}.stat-card:before{content:"";display:block;height:4px;background:var(--brand)}.input-group .form-control{border-top-left-radius:10px;border-bottom-left-radius:10px}.input-group .btn{border-top-right-radius:10px;border-bottom-right-radius:10px}
.login-page{min-height:100vh;background:linear-gradient(135deg,#f8fafc 0,#eef5ff 100%)}.login-shell{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}.login-card{width:100%;max-width:440px;border-radius:18px}.login-logo{width:56px;height:56px;border-radius:16px;display:grid;place-items:center;color:#fff;font-weight:850;background:var(--brand)}
.table-tools{border-color:var(--line)!important}.table-tools .form-control-sm,.table-tools .form-select-sm{border-radius:8px}.sortable{cursor:pointer;user-select:none;position:relative;padding-right:1.35rem!important}.sortable:after{content:"\2191\2193";position:absolute;right:.45rem;color:#94a3b8;font-size:.75rem;letter-spacing:-.08em}.table-pager .btn[disabled]{opacity:.45;cursor:not-allowed}.align-self-center{align-self:center!important}
@media (min-width:768px){.text-md-end{text-align:right!important}}
@media (max-width:900px){.hero-panel{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(360px,.9fr);gap:20px;align-items:center;min-height:0;padding:18px 0 16px;overflow:hidden}.hero-copy{padding:0}.status-board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-content:center}.section-heading{display:block}.section-heading>p{margin-top:8px}.inventory-table th,.inventory-table td{padding:9px 10px}}
@media (max-width:575.98px){.site-shell,.content-shell,.site-footer{padding-left:14px;padding-right:14px}.site-nav{height:auto;align-items:flex-start}.brand-mark strong{font-size:16px}.nav-actions{gap:4px}.hero-copy h1{font-size:24px}.hero-copy p{font-size:13px;-webkit-line-clamp:2}.status-board{display:none}.display-6{font-size:1.8rem}.card-body{padding:1rem}.table{font-size:.875rem}}
.admin-tabs{list-style:none;display:flex;flex-wrap:wrap;gap:6px;background:#fff;border:1px solid var(--line);border-radius:14px 14px 0 0;padding:10px 10px 0;margin-bottom:0;overflow-x:auto;overflow-y:hidden}.admin-tabs .nav-item{list-style:none;flex:0 0 auto}.admin-tabs .nav-link{display:inline-flex;align-items:center;justify-content:center;min-height:40px;font-weight:800;color:#64748b;border-radius:10px 10px 0 0;white-space:nowrap}.admin-tabs .nav-link.active{color:var(--brand);background:#fff;border-color:var(--line) var(--line) #fff}.admin-tab-content{background:#fff;border:1px solid var(--line);border-top:0;border-radius:0 0 14px 14px;padding:18px}.tab-content>.tab-pane{display:none}.tab-content>.tab-pane.active{display:block}.product-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.product-card{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:20px;display:flex;flex-direction:column;gap:18px}.product-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.product-card h3{font-size:19px;font-weight:850;margin:0;color:#0f172a}.product-card p{margin:6px 0 0;color:#64748b;font-size:13px}.spec-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.spec-grid div{background:#f8fafc;border:1px solid #edf2f7;border-radius:12px;padding:10px}.spec-grid span{display:block;color:#94a3b8;font-size:12px;font-weight:800}.spec-grid strong{display:block;margin-top:4px;color:#0f172a;font-size:15px}.product-card-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;color:#94a3b8;font-size:13px}.buy-button{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:0 15px;border-radius:12px;background:var(--brand);color:#fff;font-weight:850;white-space:nowrap}.buy-button:hover{background:var(--brand-strong);color:#fff}@media(max-width:1040px){.product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){.product-grid{grid-template-columns:1fr}.admin-tabs{flex-wrap:nowrap;padding-bottom:0}.admin-tabs .nav-link{min-height:38px;padding:.45rem .75rem}.admin-tab-content{padding:12px}.product-card-foot{align-items:flex-start;flex-direction:column}.buy-button{width:100%}}

/* Final compact dashboard overrides */

@media (max-width:900px){
  .hero-panel{grid-template-columns:1fr;max-height:200px;padding:14px 0;overflow:hidden}
  .status-board{grid-template-columns:repeat(4,minmax(0,1fr))}
  .status-card{min-height:68px;padding:10px}
  .status-card span{font-size:11px}
  .status-card strong{font-size:22px;margin-top:8px}
}
@media (max-width:575.98px){
  .hero-panel{max-height:200px}
  .hero-copy h1{font-size:24px}
  .hero-copy p{font-size:13px;-webkit-line-clamp:2}
  .status-board{display:none}
}
/* Admin interface */
.admin-page{background:linear-gradient(180deg,#f7fbff 0,#f4f7fb 42%,#fff 100%)}
.admin-hero{background:linear-gradient(135deg,#1d4ed8,#2563eb);color:#fff}
.admin-hero-inner{max-width:none;width:100%;margin:0 auto;padding:24px 24px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.admin-hero h1{margin:0 0 6px;font-size:30px;font-weight:850;line-height:1.15}
.admin-hero p{margin:0;color:#dbeafe;font-size:14px}
.admin-hero .eyebrow{color:#bfdbfe;margin-bottom:8px}
.admin-hero-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.admin-shell{max-width:none;width:100%;margin:0 auto}
.admin-shell-full{max-width:none!important;width:100%!important}
.admin-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.admin-metrics>div{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px 18px;box-shadow:var(--shadow)}
.admin-metrics span{display:block;color:#64748b;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.admin-metrics strong{display:block;margin-top:8px;color:#0f172a;font-size:28px;font-weight:850;line-height:1}
.admin-manage-grid{display:grid;grid-template-columns:minmax(340px,.86fr) minmax(0,1.14fr);gap:18px;align-items:start}
.admin-page .card{border-radius:16px;background:#fff;box-shadow:0 12px 34px rgba(15,23,42,.06)}
.admin-page .card-header{padding:16px 18px}
.admin-page .card-header h2{font-weight:850;color:#0f172a}
.admin-page .table td,.admin-page .table th{padding:14px 16px}
.admin-page .btn-primary{background:var(--brand);border-color:var(--brand)}
.admin-page .btn-primary:hover{background:var(--brand-strong);border-color:var(--brand-strong)}
.admin-tabs{list-style:none;display:flex;flex-wrap:wrap;gap:6px;background:#fff;border:1px solid var(--line);border-radius:16px 16px 0 0;padding:10px 10px 0;margin-bottom:0;overflow-x:auto;overflow-y:hidden}
.admin-tabs .nav-item{list-style:none;flex:0 0 auto}
.admin-tabs .nav-link{display:inline-flex;align-items:center;justify-content:center;min-height:42px;font-weight:800;color:#64748b;border-radius:12px 12px 0 0;white-space:nowrap}
.admin-tabs .nav-link.active{color:var(--brand);background:#fff;border-color:var(--line) var(--line) #fff}
.admin-tab-content{background:#fff;border:1px solid var(--line);border-top:0;border-radius:0 0 16px 16px;padding:18px;box-shadow:var(--shadow)}
@media(max-width:1020px){.admin-hero-inner{display:block}.admin-hero-actions{margin-top:16px}.admin-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-manage-grid{grid-template-columns:1fr}}
@media(max-width:575.98px){.admin-hero-inner{padding:20px 14px}.admin-metrics{grid-template-columns:1fr}.admin-tabs{flex-wrap:nowrap}.admin-tab-content{padding:12px}.admin-page .table td,.admin-page .table th{padding:12px 10px}}
/* Admin tab card layout: Tabler/Bootstrap card-header-tabs structure */
.admin-tabs-card{border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);overflow:hidden;background:#fff}
.admin-tabs-card>.card-header{background:#fff;border-bottom:1px solid var(--line);padding:0 18px;overflow-x:auto;overflow-y:hidden}
.admin-tabs-card .card-header-tabs{border-bottom:0;margin:0;gap:4px;flex-wrap:wrap;min-width:max-content}
.admin-tabs-card .card-header-tabs .nav-item{margin:0;list-style:none}
.admin-tabs-card .card-header-tabs .nav-link{min-height:54px;display:inline-flex;align-items:center;border:0;border-bottom:3px solid transparent;border-radius:0;padding:.75rem 1rem;color:#64748b;font-weight:850;white-space:nowrap;background:transparent}
.admin-tabs-card .card-header-tabs .nav-link:hover{color:var(--brand);border-bottom-color:#bfdbfe}
.admin-tabs-card .card-header-tabs .nav-link.active{color:var(--brand);background:#fff;border-bottom-color:var(--brand)}
.admin-tabs-card>.card-body{padding:18px;background:#fff}
.admin-tabs-card .tab-content>.tab-pane{display:none}
.admin-tabs-card .tab-content>.tab-pane.active{display:block}
.admin-inner-card{border:1px solid var(--line);box-shadow:0 10px 28px rgba(15,23,42,.05)}
.admin-inner-card>.card-header{border-bottom:1px solid var(--line)}
.admin-page .form-hint code{font-size:.82em;color:#1d4ed8;background:#eff6ff;border-radius:6px;padding:1px 5px}
@media(max-width:650px){.admin-tabs-card>.card-header{padding:0 10px}.admin-tabs-card .card-header-tabs{flex-wrap:nowrap}.admin-tabs-card .card-header-tabs .nav-link{min-height:46px;padding:.6rem .78rem}.admin-tabs-card>.card-body{padding:12px}}
/* Admin split tabs and modal form polish */
.admin-section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.admin-section-head h2{font-weight:850;color:#0f172a}
.admin-section-head p{max-width:720px}
.admin-page .modal-content{border:0;border-radius:18px;box-shadow:0 24px 70px rgba(15,23,42,.22)}
.admin-page .modal-header{border-bottom:1px solid var(--line);padding:18px 22px}
.admin-page .modal-title{font-weight:850;color:#0f172a}
.admin-page .modal-body{padding:22px}
.admin-page .modal-footer{border-top:1px solid var(--line);padding:16px 22px}
.admin-page .modal .form-label{font-weight:750;color:#334155}
.admin-page .admin-modal-tabs{border-bottom:1px solid var(--line);gap:6px}
.admin-page .admin-modal-tabs .nav-link{border:0;border-bottom:3px solid transparent;border-radius:10px 10px 0 0;color:#64748b;font-weight:850;padding:.65rem 1rem}
.admin-page .admin-modal-tabs .nav-link:hover{color:var(--brand);border-bottom-color:#bfdbfe;background:#f8fafc}
.admin-page .admin-modal-tabs .nav-link.active{color:var(--brand);background:#fff;border-bottom-color:var(--brand)}
.admin-page .admin-modal-tab-content{padding-top:2px}
@media(max-width:650px){.admin-section-head{display:block}.admin-section-head .btn{width:100%;margin-top:12px}.admin-page .modal-body{padding:16px}.admin-page .modal-header,.admin-page .modal-footer{padding:14px 16px}}

/* Fix card header tabs horizontal layout */
.admin-tabs-card > .card-header{display:block!important;overflow-x:auto;overflow-y:hidden;padding:0 18px!important}
.admin-tabs-card .card-header-tabs{display:flex!important;flex-direction:row!important;align-items:center!important;flex-wrap:nowrap!important;gap:4px!important;list-style:none!important;margin:0!important;padding:0!important;min-width:100%!important;width:max-content!important;border-bottom:0!important}
.admin-tabs-card .card-header-tabs .nav-item{display:block!important;flex:0 0 auto!important;margin:0!important;list-style:none!important}
.admin-tabs-card .card-header-tabs .nav-link{display:inline-flex!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important}

/* System setting grouped cards */
.system-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.system-group-card{height:100%}
.system-group-full{grid-column:1 / -1}
.system-group-card .card-header h2{font-weight:850;color:#0f172a}
@media(max-width:900px){.system-groups{grid-template-columns:1fr}}

/* Public inventory table sorting/pagination polish */
.sortable:after{content:"\2191\2193";position:absolute;right:.45rem;color:#94a3b8;font-size:.75rem;letter-spacing:-.08em}
.sortable.sort-asc:after{content:"\2191";color:var(--brand);letter-spacing:normal}
.sortable.sort-desc:after{content:"\2193";color:var(--brand);letter-spacing:normal}
.table-pager .btn{min-width:34px}
.tg-action{background:#22a3e6;box-shadow:0 8px 18px rgba(34,163,230,.18)}
.tg-action:hover{background:#1688c4;color:#fff}

/* Admin Ajax and Toastr interaction polish */
.admin-page .ajax-toggle{cursor:pointer}
.admin-page .ajax-toggle:disabled{cursor:wait;opacity:.65}
.admin-page .ajax-confirm-form{margin:0}
.admin-page td .form-switch{display:flex;align-items:center;justify-content:center;min-height:32px;padding-left:2.5rem}
#toast-container .toast{font-family:Inter,"Segoe UI","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji",Arial,"Microsoft YaHei",sans-serif}

/* Frontend enable switch: keep it at the top of the display settings form */
.public-switch-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;border:1px solid #dbeafe;background:#eff6ff;border-radius:16px}
.public-switch-card .form-switch{padding-left:0}
.public-switch-card .form-check-input{width:3.2rem;height:1.65rem;margin:0;cursor:pointer}
@media(max-width:575.98px){.public-switch-card{align-items:flex-start;flex-direction:column}.public-switch-card .form-check-input{width:3rem;height:1.55rem}}
.row-action-disabled,.row-action-disabled:hover{background:#f1f5f9;color:#94a3b8;cursor:not-allowed;pointer-events:none;text-decoration:none}.inventory-table [data-role="stock-status"],.inventory-table [data-role="buy-action"]{white-space:nowrap}

/* Front inventory table manual refresh button */
.table-toolbar-main{display:flex;align-items:center;gap:8px}
.table-toolbar-main .table-search{min-width:0;flex:1 1 auto}
.table-toolbar-main .table-merchant-filter{min-width:150px;max-width:220px;flex:0 0 180px}
.table-refresh-button{display:inline-flex;align-items:center;justify-content:center;width:34px;height:31px;padding:0;flex:0 0 auto}
.table-refresh-button svg{transition:transform .2s ease}
.table-refresh-button.is-loading svg{animation:stockRefreshSpin .8s linear infinite}
@keyframes stockRefreshSpin{to{transform:rotate(360deg)}}

/* Password visibility toggle */
.password-input-group .password-toggle{display:inline-flex;align-items:center;justify-content:center;color:#64748b}
.password-input-group .password-toggle.active{color:var(--brand);background:#eff6ff;border-color:#bfdbfe}
.password-input-group .password-toggle svg{pointer-events:none}

/* Backup list Ajax refresh button */
.backup-refresh-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:31px;padding:0}
.backup-refresh-btn svg{transition:transform .2s ease}
.backup-refresh-btn.is-loading svg{animation:stockRefreshSpin .8s linear infinite}

.last-detected-badge,.last-check-text{font-size:12px!important;white-space:nowrap;line-height:1.2}.admin-metrics .last-check-text{font-size:16px!important}
.placeholder-panel{border:1px solid rgba(15,23,42,.1);border-radius:14px;background:#f8fafc;padding:14px}
.placeholder-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:8px 14px}
.placeholder-grid>div{display:flex;gap:8px;align-items:flex-start;font-size:.875rem}
.placeholder-grid code{white-space:nowrap;color:#0f766e;background:#ecfeff;border:1px solid #bae6fd;border-radius:6px;padding:2px 6px}
.telegram-keyboard-row .btn{min-height:38px}
.table-inline-toast{position:absolute;right:16px;top:10px;z-index:5;background:#0f172a;color:#fff;border-radius:10px;padding:8px 12px;font-size:.875rem;box-shadow:0 10px 30px rgba(15,23,42,.18)}
.table-tools{position:relative}
.log-refresh-btn.is-loading svg,.backup-refresh-btn.is-loading svg,.admin-products-refresh-btn.is-loading svg{animation:stockRefreshSpin .8s linear infinite}

.admin-products-refresh-btn{display:inline-flex;align-items:center;justify-content:center;width:42px}
.table-stock-filter{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;color:#334155;font-size:13px;font-weight:700;flex:0 0 auto}
.table-stock-filter .form-check-input{margin:0;cursor:pointer}
@media(max-width:575.98px){.table-toolbar-main{flex-wrap:wrap}.table-toolbar-main .table-merchant-filter{width:100%;max-width:none;flex:1 1 100%}.table-stock-filter{width:100%;justify-content:flex-start}}


.product-page-display{max-width:260px;cursor:help}
.stock-buy-btn{min-width:64px;font-weight:800;border-radius:10px}
.inventory-table [data-role="buy-action"] .btn{white-space:nowrap}

/* Emoji / UTF-8 four-byte character rendering support for the public board. */
.emoji-support,
.emoji-support .inventory-table,
.emoji-support .brand-mark,
.emoji-support .hero-copy,
.emoji-support .stock-pill,
.emoji-support .btn {
  font-family: Inter,"Segoe UI","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji",Arial,"Microsoft YaHei",sans-serif;
}
.emoji-support [data-emoji],
.emoji-support .emoji-text {
  font-family: "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji",sans-serif;
  font-style: normal;
  font-variant-emoji: emoji;
}

/* Public homepage mobile friendly layout */
.public-section-heading .section-desc{margin:6px 0 0;color:#64748b;font-size:14px;line-height:1.55}
@media(max-width:768px){
  body.public-page{min-width:0;overflow-x:hidden}
  .site-shell{padding:12px 12px 0;max-width:100%}
  .site-nav{height:auto;min-height:56px;padding:8px 10px;background:rgba(255,255,255,.92);border:1px solid var(--line);border-radius:16px;box-shadow:0 10px 26px rgba(15,23,42,.06);gap:10px}
  .brand-mark{min-width:0;flex:1 1 auto;gap:9px}
  .brand-mark span{width:34px;height:34px;border-radius:10px;font-size:15px;flex:0 0 auto}
  .brand-mark strong{font-size:15px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100vw - 190px)}
  .nav-actions{flex:0 0 auto;gap:6px}
  .nav-actions a{font-size:13px;padding:7px 9px}
  .hero-panel{display:block!important;max-height:none!important;overflow:visible!important;padding:14px 0 10px!important}
  .hero-copy h1{font-size:24px;line-height:1.22;margin-bottom:8px;letter-spacing:-.02em}
  .hero-copy p{font-size:14px;line-height:1.6;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;margin-bottom:12px}
  .hero-actions{display:grid;grid-template-columns:1fr;gap:8px;font-size:12px}
  .last-detected-badge{display:flex;align-items:center;justify-content:center;min-height:34px;width:100%;padding:0 10px;border:1px solid #dbeafe;border-radius:10px;background:#eff6ff;color:#1e40af;overflow:hidden;text-overflow:ellipsis}
  .hero-actions .primary-action{width:100%;min-height:38px;border-radius:11px}
  .status-board{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px;margin-top:12px}
  .status-card{min-height:74px;padding:12px;border-radius:14px;box-shadow:0 10px 24px rgba(15,23,42,.06)}
  .status-card span{font-size:11px;letter-spacing:.06em}
  .status-card strong{font-size:25px;margin-top:8px}
  .content-shell{padding:12px 12px 34px;max-width:100%}
  .public-section-heading{display:block;margin:4px 0 10px}
  .public-section-heading .eyebrow{margin-bottom:5px}
  .public-section-heading h2{font-size:22px;line-height:1.25;margin:0;font-weight:850}
  .public-section-heading .section-desc{font-size:13px;margin-top:5px}
  .public-inventory-card{border:0;background:transparent;box-shadow:none;border-radius:0;overflow:visible}
  .public-table-responsive{overflow:visible!important}
  .inventory-table{display:block;width:100%;border-collapse:separate;border-spacing:0;background:transparent}
  .inventory-table thead{display:none}
  .inventory-table tbody{display:block;width:100%}
  .inventory-table tr{display:grid;width:100%;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 8px;margin:0 0 10px;padding:10px;background:#fff;border:1px solid var(--line);border-radius:15px;box-shadow:0 10px 26px rgba(15,23,42,.07)}
  .inventory-table td{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:2px;width:100%;min-height:50px;padding:6px 8px!important;border:1px solid #edf2f7!important;border-radius:11px;background:#f8fafc;text-align:left;color:#0f172a;font-size:13px;line-height:1.35;word-break:break-word}
  .inventory-table td::before{content:attr(data-label);display:block;text-align:left;color:#64748b;font-size:11px;font-weight:800;letter-spacing:.03em;white-space:nowrap}
  .inventory-table td.product-cell{grid-column:1 / -1;display:block;text-align:left;min-height:auto;padding:0 0 8px!important;margin-bottom:0;border:0!important;border-bottom:1px dashed #e2e8f0!important;border-radius:0;background:transparent}
  .inventory-table td.product-cell::before{display:none;content:""}
  .inventory-table .product-title-row{display:flex!important;align-items:center;gap:7px;min-width:0;flex-wrap:wrap}
  .inventory-table .product-name{display:block;min-width:0;font-size:15px;line-height:1.35;font-weight:850;color:#0f172a;overflow:hidden;text-overflow:ellipsis}
  .inventory-table .product-stock-pill{display:inline-flex!important;flex:0 0 auto;min-height:22px;padding:0 7px;font-size:11px;line-height:22px;border-radius:999px;white-space:nowrap}
  .inventory-table .merchant-cell{color:#475569}
  .inventory-table .price-cell{font-size:16px;color:#1d4ed8}
  .inventory-table [data-role="stock-status"]{display:none!important}
  .inventory-table [data-role="buy-action"]{grid-column:1 / -1;display:flex;min-height:38px;align-items:center;justify-content:center;white-space:normal;text-align:center;background:transparent;border:0!important;padding:2px 0 0!important}
  .inventory-table [data-role="buy-action"]::before{display:none;content:""}
  .inventory-table [data-role="buy-action"] .btn{width:auto;min-width:90px;min-height:32px;padding-left:16px;padding-right:16px;border-radius:10px}
  .inventory-table td.table-empty-row{grid-column:1 / -1;display:block!important;text-align:center;padding:28px 12px!important;color:#64748b;background:#fff;border-radius:14px}
  .inventory-table td.table-empty-row::before{display:none;content:""}
  .table-tools{padding:12px!important;margin-bottom:12px;border:1px solid var(--line)!important;border-radius:16px;background:#fff!important;box-shadow:0 10px 26px rgba(15,23,42,.06)}
  .table-tools .row{--bs-gutter-y:.5rem}
  .table-toolbar-main{display:grid;grid-template-columns:minmax(0,1fr) 40px;gap:8px;align-items:center;width:100%}
  .table-toolbar-main .table-search{width:100%;height:38px;font-size:14px}
  .table-toolbar-main .table-merchant-filter{grid-column:1 / -1;width:100%;max-width:none}
  .table-refresh-button{width:40px;height:38px;border-radius:10px}
  .table-stock-filter{grid-column:1 / -1;width:100%;justify-content:flex-start;padding:8px 10px;border-radius:10px;background:#f8fafc;border:1px solid #e2e8f0}
  .table-tools .table-info{text-align:left!important;font-size:12px;padding-top:2px}
  .table-pager{justify-content:center!important;margin-top:10px!important}
  .table-pager .btn{min-width:36px;min-height:34px;border-radius:10px}
  .site-footer{padding:10px 14px 30px;font-size:12px;text-align:center}
}
@media(max-width:380px){
  .brand-mark strong{max-width:calc(100vw - 168px);font-size:14px}
  .nav-actions a{padding:6px 7px;font-size:12px}
  .status-card strong{font-size:23px}
  .inventory-table td{font-size:13px;gap:10px}
  /*.inventory-table td::before{flex-basis:48px}*/
}

/* Product title inline stock badge: keep visible in list/card mode. */
.inventory-table .product-title-row .product-stock-pill{display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 auto;min-height:22px;padding:0 7px;font-size:11px;line-height:22px;border-radius:999px;white-space:nowrap}

@media(min-width:768px){
	.inventory-table .product-title-row .product-stock-pill {
		display: none!important;
	}
}.proxy-refresh-btn.is-loading svg{animation:stockRefreshSpin .8s linear infinite}
.placeholder-panel summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:.5rem}
.placeholder-panel summary::-webkit-details-marker{display:none}
.placeholder-panel summary:after{content:'\5C55\5F00';font-size:12px;font-weight:700;color:#64748b;margin-left:auto}
.placeholder-panel[open] summary:after{content:'\6536\8D77'}
.metric-mini{border:1px solid var(--line);border-radius:14px;background:#fff;padding:14px 16px;box-shadow:0 10px 26px rgba(15,23,42,.05)}
.metric-mini span{display:block;color:#64748b;font-size:12px;font-weight:800}.metric-mini strong{display:block;color:#0f172a;font-size:22px;margin-top:4px}

/* Public footer copyright and friend links */
.site-footer{display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center;border-top:1px solid var(--line);margin-top:28px;color:#64748b}
.site-footer .footer-main{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;justify-content:center;line-height:1.7}
.site-footer .footer-copyright{font-weight:700;color:#334155}
.site-footer .footer-note{color:#64748b}
.friend-links{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center;justify-content:center;max-width:1120px;line-height:1.8}
.friend-links-title{font-weight:700;color:#475569}
.friend-links-list{display:inline;line-height:1.8}
.friend-links-list a{display:inline;color:#64748b;text-decoration:none;padding:0;margin:0 4px;background:transparent;border:0;border-radius:0;transition:color .18s ease}
.friend-links-list a:hover{color:#2563eb;text-decoration:underline;background:transparent}
.friend-links-list a + a::before{content:"|";display:inline-block;margin:0 8px 0 2px;color:#cbd5e1;text-decoration:none}
@media(max-width:768px){
  .site-footer .footer-main{display:block;text-align:center}
  .friend-links{align-items:flex-start;gap:6px}
  .friend-links-title{width:100%;text-align:center}
}
.redis-value-preview {
  max-width: 560px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .78rem;
  background: rgba(15, 23, 42, .04);
  border-radius: .5rem;
  padding: .5rem;
}

/* Public custom HTML content and theme switch */
.public-html-content{line-height:1.65}
.public-html-content p{margin:0 0 .55rem}
.public-html-content p:last-child{margin-bottom:0}
.public-html-content a{color:var(--brand);font-weight:700;text-decoration:underline;text-underline-offset:2px}
.public-html-content ul,.public-html-content ol{margin:.35rem 0 .35rem 1.2rem;padding:0}
.hero-intro{font-size:14px;line-height:1.5;color:#475569;max-width:720px;margin:0 0 10px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:34px;padding:0 11px;border:1px solid var(--line);border-radius:999px;background:#fff;color:#475569;font-weight:800;font-size:13px;line-height:1;cursor:pointer;transition:background .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease}
.theme-toggle:hover{background:#eaf1ff;color:var(--brand-strong);box-shadow:0 8px 18px rgba(15,23,42,.08)}
.theme-icon{font-size:14px;line-height:1}

html[data-theme="dark"]{color-scheme:dark;--page:#080e1c;--panel:#0f172a;--ink:#e5edf7;--muted:#94a3b8;--line:#243244;--brand:#60a5fa;--brand-strong:#93c5fd;--good:#22c55e;--warn:#f59e0b;--bad:#f87171;--soft-blue:#10233f;--shadow:0 18px 45px rgba(0,0,0,.35)}
html[data-theme="dark"] body{background:var(--page);color:var(--ink)}
html[data-theme="dark"] .public-home{background:radial-gradient(circle at top left,rgba(37,99,235,.22),transparent 32%),linear-gradient(180deg,#08111f 0,#0b1120 48%,#111827 100%)}
html[data-theme="dark"] .site-nav{background:rgba(15,23,42,.78);border-color:var(--line);box-shadow:0 14px 34px rgba(0,0,0,.26)}
html[data-theme="dark"] .brand-mark{color:var(--ink)}
html[data-theme="dark"] .brand-mark span{background:#2563eb;color:#fff}
html[data-theme="dark"] .nav-actions a,html[data-theme="dark"] .theme-toggle{background:#101a2d;color:#cbd5e1;border-color:var(--line)}
html[data-theme="dark"] .nav-actions a:hover,html[data-theme="dark"] .theme-toggle:hover{background:#1e3a5f;color:#bfdbfe}
html[data-theme="dark"] .admin-link{background:#101a2d;border-color:var(--line)}
html[data-theme="dark"] .eyebrow{color:#93c5fd}
html[data-theme="dark"] .hero-copy h1,html[data-theme="dark"] .section-heading h2,html[data-theme="dark"] .product-name{color:#f8fafc}
html[data-theme="dark"] .hero-intro,html[data-theme="dark"] .section-desc,html[data-theme="dark"] .hero-actions,html[data-theme="dark"] .product-meta,html[data-theme="dark"] .checked-at{color:#94a3b8}
html[data-theme="dark"] .status-card,html[data-theme="dark"] .inventory-card,html[data-theme="dark"] .table-tools{background:#111827;border-color:var(--line);box-shadow:var(--shadow)}
html[data-theme="dark"] .status-card span,html[data-theme="dark"] .empty-state p{color:#94a3b8}
html[data-theme="dark"] .status-card strong{color:#f8fafc}
html[data-theme="dark"] .inventory-table{--bs-table-bg:#111827;--bs-table-color:#e5edf7;--bs-table-border-color:#233044;--bs-table-hover-bg:#172033;--bs-table-hover-color:#f8fafc;color:#e5edf7}
html[data-theme="dark"] .table>thead th{background:#172033;color:#cbd5e1;border-color:#233044}
html[data-theme="dark"] .inventory-table td{border-color:#233044;color:#e5edf7}
html[data-theme="dark"] .row-action{background:#172b49;color:#bfdbfe}
html[data-theme="dark"] .row-action:hover{background:#1d3d66;color:#dbeafe}
html[data-theme="dark"] .stock-in_stock{background:rgba(34,197,94,.16);color:#86efac}
html[data-theme="dark"] .stock-out_of_stock{background:rgba(248,113,113,.16);color:#fca5a5}
html[data-theme="dark"] .stock-unknown{background:#1e293b;color:#cbd5e1}
html[data-theme="dark"] .last-detected-badge{background:#10233f;border-color:#1d4e89;color:#bfdbfe}
html[data-theme="dark"] .site-footer{color:#94a3b8;border-top-color:var(--line)}
html[data-theme="dark"] .site-footer .footer-copyright,html[data-theme="dark"] .friend-links-title{color:#e5edf7}
html[data-theme="dark"] .site-footer .footer-note,html[data-theme="dark"] .friend-links-list a{color:#94a3b8}
html[data-theme="dark"] .friend-links-list a:hover{color:#bfdbfe}
html[data-theme="dark"] .friend-links-list a + a::before{color:#475569}
html[data-theme="dark"] .form-control,html[data-theme="dark"] .form-select{background:#0f172a;color:#e5edf7;border-color:#334155}
html[data-theme="dark"] .form-control::placeholder{color:#64748b}
html[data-theme="dark"] .btn-outline-secondary{color:#cbd5e1;border-color:#334155}
html[data-theme="dark"] .btn-outline-secondary:hover{background:#1e293b;color:#f8fafc}
html[data-theme="dark"] .btn-outline-primary{color:#bfdbfe;border-color:#2563eb}
html[data-theme="dark"] .btn-outline-primary:hover{background:#1d4ed8;color:#fff}
html[data-theme="dark"] .pagination .page-link,html[data-theme="dark"] .table-pager .btn{background:#0f172a;color:#cbd5e1;border-color:#334155}
html[data-theme="dark"] .pagination .page-link:hover,html[data-theme="dark"] .table-pager .btn:hover{background:#1e293b;color:#fff}
@media(max-width:768px){
  html[data-theme="dark"] .site-nav{background:rgba(15,23,42,.94)}
  html[data-theme="dark"] .inventory-table tr{background:#111827;border-color:var(--line);box-shadow:var(--shadow)}
  html[data-theme="dark"] .inventory-table td{background:#172033;border-color:#233044!important;color:#e5edf7}
  html[data-theme="dark"] .inventory-table td::before{color:#94a3b8}
  html[data-theme="dark"] .inventory-table td.product-cell{background:transparent!important;border-bottom-color:#334155!important}
  html[data-theme="dark"] .inventory-table .product-name{color:#f8fafc}
  html[data-theme="dark"] .table-stock-filter{background:#172033;border-color:#334155;color:#cbd5e1}
}
@media(max-width:575.98px){.theme-toggle .theme-text{display:none}.theme-toggle{width:36px;padding:0}}
@media(max-width:768px){
  .hero-intro{font-size:14px;line-height:1.6;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;margin-bottom:12px}
}

/* Dark theme hard overrides for Bootstrap utility classes and switches. */
html[data-theme="dark"] .bg-white{background-color:#111827!important}
html[data-theme="dark"] .border-bottom{border-bottom-color:var(--line)!important}
html[data-theme="dark"] .text-secondary{color:#94a3b8!important}
html[data-theme="dark"] .table-tools,
html[data-theme="dark"] .table-tools.bg-white,
html[data-theme="dark"] .table-tools.border-bottom{background:#111827!important;background-color:#111827!important;border-color:var(--line)!important;color:#cbd5e1!important;box-shadow:var(--shadow)}
html[data-theme="dark"] .table-tools .table-info{color:#94a3b8!important}
html[data-theme="dark"] .table-tools .form-control,
html[data-theme="dark"] .table-tools .form-select{background-color:#0f172a!important;color:#e5edf7!important;border-color:#334155!important}
html[data-theme="dark"] .table-tools .form-control:focus,
html[data-theme="dark"] .table-tools .form-select:focus{border-color:#60a5fa!important;box-shadow:0 0 0 .2rem rgba(96,165,250,.18)!important}
html[data-theme="dark"] .table-tools .btn-outline-secondary{background-color:#0f172a;color:#cbd5e1;border-color:#334155}
html[data-theme="dark"] .table-tools .btn-outline-secondary:hover{background-color:#1e293b;color:#fff;border-color:#475569}

.table-stock-filter{display:inline-flex;align-items:center;gap:8px;min-height:31px;padding:4px 10px;border:1px solid #e2e8f0;border-radius:999px;background:#f8fafc;color:#475569;font-weight:700;font-size:13px;white-space:nowrap}
.table-stock-filter .form-check-label{cursor:pointer;line-height:1.2}
.form-switch .form-check-input{cursor:pointer;transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease;background-position:left center}
.form-switch .form-check-input:focus{box-shadow:0 0 0 .2rem rgba(37,99,235,.18)}
html[data-theme="dark"] .table-stock-filter{background:#172033!important;border-color:#334155!important;color:#cbd5e1!important}
html[data-theme="dark"] .form-check-label{color:#cbd5e1}
html[data-theme="dark"] .form-check-input{background-color:#0f172a;border-color:#475569}
html[data-theme="dark"] .form-check-input:focus{border-color:#60a5fa;box-shadow:0 0 0 .2rem rgba(96,165,250,.18)}
html[data-theme="dark"] .form-switch .form-check-input{background-color:#1e293b;border-color:#475569;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2394a3b8'/%3e%3c/svg%3e")!important}
html[data-theme="dark"] .form-check-input:checked{background-color:#2563eb!important;border-color:#60a5fa!important}
html[data-theme="dark"] .form-switch .form-check-input:checked{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e")!important;background-position:right center}

/* Telegram subscriber detail modal */
.subscriber-detail-panel .detail-item{border:1px solid var(--line);border-radius:12px;background:#f8fafc;padding:12px 14px;height:100%}
.subscriber-detail-panel .detail-item span{display:block;color:#64748b;font-size:12px;font-weight:800;margin-bottom:4px}
.subscriber-detail-panel .detail-item strong{display:block;color:#0f172a;font-size:14px;word-break:break-all}


.telegram-config-details>summary{list-style:none;cursor:pointer;user-select:none}
.telegram-config-details>summary::-webkit-details-marker{display:none}
.telegram-config-summary{display:flex;align-items:center;justify-content:space-between;gap:12px}
.telegram-config-toggle-close{display:none}
.telegram-config-details[open] .telegram-config-toggle-open{display:none}
.telegram-config-details[open] .telegram-config-toggle-close{display:inline}
.telegram-subscriber-product-detail-btn{font-weight:700}

.tg-subscriber-compact-table th,
.tg-subscriber-compact-table td{padding:.28rem .5rem!important;vertical-align:middle}
.tg-subscriber-compact-table th{font-size:.82rem;white-space:nowrap}
.tg-subscriber-compact-table td{font-size:.86rem}
.tg-subscriber-compact-table code{font-size:.78rem}
.tg-subscriber-compact-table .badge,
.tg-subscriber-compact-table .btn-sm{font-size:.74rem;line-height:1.15;padding:.18rem .42rem}
@media(max-width:768px){.telegram-config-summary{align-items:flex-start;flex-direction:column}}
html[data-theme="dark"] .subscriber-detail-panel .detail-item{background:#0f172a;border-color:#334155}
html[data-theme="dark"] .subscriber-detail-panel .detail-item strong{color:#f8fafc}

/* Telegram subscriber product detail AJAX state */
.telegram-subscriber-detail-body.is-loading { opacity: .65; pointer-events: none; }
.telegram-subscriber-detail-table th:last-child,
.telegram-subscriber-detail-table td:last-child { width: 86px; white-space: nowrap; }
.placeholder-panel-compact{padding:10px 12px}
.placeholder-compact-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:10px}
.placeholder-compact-group{border:1px solid rgba(15,23,42,.08);border-radius:10px;background:rgba(255,255,255,.75);padding:8px}
.placeholder-compact-title{font-size:12px;font-weight:800;color:#64748b;margin-bottom:6px}
.placeholder-compact-grid{display:flex;flex-wrap:wrap;gap:6px}
.placeholder-chip{display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:4px 7px;border:1px solid rgba(14,116,144,.16);border-radius:999px;background:#ecfeff;font-size:12px;line-height:1.2}
.placeholder-chip code{padding:0;border:0;background:transparent;color:#0f766e;white-space:nowrap}
.placeholder-chip span{color:#475569;white-space:nowrap}
html[data-theme="dark"] .placeholder-compact-group{background:rgba(15,23,42,.72);border-color:rgba(148,163,184,.22)}
html[data-theme="dark"] .placeholder-chip{background:rgba(8,145,178,.12);border-color:rgba(103,232,249,.22)}
html[data-theme="dark"] .placeholder-chip span{color:#cbd5e1}

/* Telegram HTML note live preview */
.telegram-note-preview-wrap{border:1px solid #dbeafe;border-radius:12px;background:#f8fbff;overflow:hidden}
.telegram-note-preview-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border-bottom:1px solid #dbeafe;background:#eff6ff;color:#1e40af}
.telegram-note-preview-head strong{font-size:12px;font-weight:850}
.telegram-note-preview-head span{font-size:12px;color:#64748b}
.telegram-note-preview{min-height:48px;padding:10px 12px;color:#0f172a;background:#fff;white-space:pre-wrap;word-break:break-word;line-height:1.55}
.telegram-note-preview.is-empty:before{content:attr(data-empty);color:#94a3b8}
.telegram-note-preview a{color:#2563eb;text-decoration:underline;text-underline-offset:2px}
.telegram-note-preview code{display:inline-block;padding:1px 5px;border-radius:6px;background:#f1f5f9;color:#334155;font-size:.9em}
.telegram-note-preview pre{display:block;margin:.35rem 0 0;padding:8px 10px;border-radius:8px;background:#f1f5f9;color:#334155;white-space:pre-wrap;overflow:auto}
.telegram-note-preview blockquote{margin:.35rem 0 0;padding:6px 10px;border-left:3px solid #60a5fa;background:#f8fafc;color:#334155;border-radius:0 8px 8px 0}
html[data-theme="dark"] .telegram-note-preview-wrap{background:#0f172a;border-color:#334155}
html[data-theme="dark"] .telegram-note-preview-head{background:#172033;border-color:#334155;color:#bfdbfe}
html[data-theme="dark"] .telegram-note-preview-head span{color:#94a3b8}
html[data-theme="dark"] .telegram-note-preview{background:#111827;color:#e5edf7}
html[data-theme="dark"] .telegram-note-preview code,
html[data-theme="dark"] .telegram-note-preview pre{background:#0f172a;color:#cbd5e1}
html[data-theme="dark"] .telegram-note-preview blockquote{background:#0f172a;color:#cbd5e1;border-left-color:#60a5fa}

/* v11: Public inventory IP column and compact single-line desktop layout */
@media(min-width:769px){
  .public-inventory-card .table-responsive{overflow-x:auto}
  .inventory-table{font-size:13px;table-layout:auto;white-space:nowrap}
  .inventory-table th,.inventory-table td{padding:8px 9px;vertical-align:middle;white-space:nowrap}
  .inventory-table .product-cell{max-width:220px}
  .inventory-table .product-title-row{flex-wrap:nowrap;overflow:hidden}
  .inventory-table .product-name{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}
  .inventory-table .ip-address-cell{font-weight:400;color:#334155;max-width:112px;overflow:hidden;text-overflow:ellipsis}
  .inventory-table .stock-pill{min-height:24px;padding:0 8px;font-size:11px}
  .inventory-table .stock-buy-btn{min-width:58px;padding:.25rem .55rem}
}
html[data-theme="dark"] .inventory-table .ip-address-cell{color:#cbd5e1}

/* v12: compact Telegram placeholder table */
.placeholder-panel-table{padding:8px 10px}
.telegram-placeholder-table{font-size:12px;line-height:1.25}
.telegram-placeholder-table th,.telegram-placeholder-table td{padding:5px 7px;white-space:nowrap;vertical-align:middle}
.telegram-placeholder-table code{color:#0f766e;background:#ecfeff;border:1px solid #bae6fd;border-radius:6px;padding:1px 5px;font-size:12px}
.telegram-placeholder-table .placeholder-group-cell{font-weight:800;color:#475569;background:#f8fafc;text-align:center;min-width:48px}
.telegram-placeholder-table .placeholder-example{display:inline-block;max-width:220px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
html[data-theme="dark"] .telegram-placeholder-table .placeholder-group-cell{color:#cbd5e1;background:#111827}
html[data-theme="dark"] .telegram-placeholder-table code{background:rgba(8,145,178,.12);border-color:rgba(103,232,249,.22);color:#67e8f9}

/* v23: SEO-friendly product detail page */
.product-detail-page{background:linear-gradient(180deg,#f7fbff 0,#f4f7fb 42%,#ffffff 100%)}
.product-site-shell{padding-bottom:0}
.product-detail-shell{padding-top:18px}
.product-breadcrumb{margin:0 0 14px;color:#64748b;font-size:13px}
.product-breadcrumb ol{display:flex;align-items:center;flex-wrap:wrap;gap:7px;list-style:none;margin:0;padding:0}
.product-breadcrumb li+li:before{content:"/";margin-right:7px;color:#94a3b8}
.product-breadcrumb a{color:#2563eb;font-weight:700}
.product-detail-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,.32fr);gap:18px;align-items:stretch;background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);padding:24px}
.product-detail-main h1{margin:0 0 10px;font-size:34px;line-height:1.16;font-weight:900;color:#0f172a;letter-spacing:-.02em}
.product-detail-desc{margin:0;color:#475569;font-size:15px;line-height:1.75;max-width:820px}
.product-detail-meta{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin-top:16px;color:#64748b;font-size:13px}
.product-detail-status{min-height:28px;padding:0 11px}
.product-detail-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:20px}
.secondary-action{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 14px;border-radius:10px;border:1px solid var(--line);background:#fff;color:#334155;font-weight:800}
.secondary-action:hover{background:#f8fafc;color:#1d4ed8}
.secondary-action.disabled{opacity:.7;pointer-events:none;color:#94a3b8}
.product-buy-action{min-width:108px}
.product-price-panel{display:flex;flex-direction:column;justify-content:center;gap:7px;border:1px solid #dbeafe;background:linear-gradient(180deg,#eff6ff,#fff);border-radius:18px;padding:18px;text-align:left}
.product-price-panel span{color:#64748b;font-size:12px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}
.product-price-panel strong{font-size:28px;line-height:1.15;font-weight:900;color:#0f172a;word-break:break-word}
.product-price-panel small{color:#64748b;font-weight:700}
.product-spec-card,.product-seo-content{margin-top:18px;background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow);padding:20px}
.product-spec-heading{margin-bottom:14px}
.product-spec-heading h2{font-size:24px}
.product-spec-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.product-spec-item{border:1px solid #edf2f7;background:#f8fafc;border-radius:14px;padding:12px;min-width:0}
.product-spec-item span{display:block;color:#64748b;font-size:12px;font-weight:850;margin-bottom:5px}
.product-spec-item strong{display:block;color:#0f172a;font-size:15px;font-weight:800;word-break:break-word}
.product-seo-content h2{margin:0 0 10px;font-size:22px;font-weight:900;color:#0f172a}
.product-seo-content p{margin:8px 0 0;color:#475569;line-height:1.8;font-size:14px}
.stock-history-list{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:8px;max-height:260px;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;padding-right:4px}
.stock-history-item{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #edf2f7;background:#f8fafc;border-radius:12px;padding:9px 12px;color:#334155;font-size:14px}
.stock-history-item time{font-variant-numeric:tabular-nums;color:#475569;font-weight:700}
.stock-history-empty{color:#64748b!important}
.product-name-link{font-weight:800;color:#0f172a;min-width:0}
.product-name-link:hover{color:#1d4ed8;text-decoration:underline;text-underline-offset:2px}
@media(max-width:900px){.product-detail-card{grid-template-columns:1fr}.product-spec-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.product-detail-main h1{font-size:28px}}
@media(max-width:575.98px){.product-detail-card,.product-spec-card,.product-seo-content{border-radius:16px;padding:16px}.product-detail-main h1{font-size:24px}.product-detail-actions{display:grid;grid-template-columns:1fr}.product-buy-action,.secondary-action{width:100%}.product-spec-grid{grid-template-columns:1fr}.product-price-panel strong{font-size:24px}}
html[data-theme="dark"] .product-detail-page{background:linear-gradient(180deg,#07111f 0,#0f172a 52%,#111827 100%)}
html[data-theme="dark"] .product-detail-card,
html[data-theme="dark"] .product-spec-card,
html[data-theme="dark"] .product-seo-content{background:#111827;border-color:#334155;box-shadow:0 18px 45px rgba(0,0,0,.26)}
html[data-theme="dark"] .product-detail-main h1,
html[data-theme="dark"] .product-price-panel strong,
html[data-theme="dark"] .product-spec-item strong,
html[data-theme="dark"] .product-seo-content h2,
html[data-theme="dark"] .product-name-link{color:#f8fafc}
html[data-theme="dark"] .product-detail-desc,
html[data-theme="dark"] .product-seo-content p{color:#cbd5e1}
html[data-theme="dark"] .product-detail-meta,
html[data-theme="dark"] .product-breadcrumb,
html[data-theme="dark"] .product-price-panel small,
html[data-theme="dark"] .product-spec-item span{color:#94a3b8}
html[data-theme="dark"] .product-price-panel{background:linear-gradient(180deg,#172033,#111827);border-color:#334155}
html[data-theme="dark"] .product-spec-item{background:#0f172a;border-color:#334155}
html[data-theme="dark"] .stock-history-item{background:#0f172a;border-color:#334155;color:#cbd5e1}
html[data-theme="dark"] .stock-history-item time{color:#cbd5e1}
html[data-theme="dark"] .secondary-action{background:#0f172a;border-color:#334155;color:#e5edf7}
html[data-theme="dark"] .secondary-action:hover{background:#172033;color:#bfdbfe}

/* v24: product introduction and SEO content improvements */
.product-intro-section p{font-size:15px}
.product-description-content{color:#475569;line-height:1.85;font-size:14px}
.product-description-content p{margin:8px 0 0}
.product-description-content a{color:#2563eb;font-weight:800;text-decoration:underline;text-underline-offset:2px}
.product-description-content ul,.product-description-content ol,.product-buying-guide ul{margin:8px 0 0;padding-left:1.25rem;color:#475569;line-height:1.85;font-size:14px}
.product-description-content li,.product-buying-guide li{margin:4px 0}
.product-description-content h2,.product-description-content h3,.product-description-content h4{margin:14px 0 8px;color:#0f172a;font-weight:900;font-size: 18px;}
html[data-theme="dark"] .product-description-content,
html[data-theme="dark"] .product-description-content ul,
html[data-theme="dark"] .product-description-content ol,
html[data-theme="dark"] .product-buying-guide ul{color:#cbd5e1}
html[data-theme="dark"] .product-description-content h2,
html[data-theme="dark"] .product-description-content h3,
html[data-theme="dark"] .product-description-content h4{color:#f8fafc}
html[data-theme="dark"] .product-description-content a{color:#93c5fd}

/* v28: product FAQ content */
.product-faq-section .product-faq-content h2,
.product-faq-section .product-faq-content h3,
.product-faq-section .product-faq-content h4{margin-top:14px;margin-bottom:8px;font-size:16px;font-weight:900;color:#0f172a}
.product-faq-section .product-faq-content h2:first-child,
.product-faq-section .product-faq-content h3:first-child,
.product-faq-section .product-faq-content h4:first-child{margin-top:0}
.product-faq-section .product-faq-content details{border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#f8fafc;margin:10px 0}
.product-faq-section .product-faq-content summary{cursor:pointer;font-weight:900;color:#0f172a}
.product-faq-section .product-faq-content dl{margin:0}
.product-faq-section .product-faq-content dt{font-weight:900;color:#0f172a;margin-top:10px}
.product-faq-section .product-faq-content dd{margin:4px 0 10px;color:#475569}
html[data-theme="dark"] .product-faq-section .product-faq-content h2,
html[data-theme="dark"] .product-faq-section .product-faq-content h3,
html[data-theme="dark"] .product-faq-section .product-faq-content h4,
html[data-theme="dark"] .product-faq-section .product-faq-content summary,
html[data-theme="dark"] .product-faq-section .product-faq-content dt{color:#f8fafc}
html[data-theme="dark"] .product-faq-section .product-faq-content details{background:#0f172a;border-color:#334155}
html[data-theme="dark"] .product-faq-section .product-faq-content dd{color:#cbd5e1}

/* Public product category switch */
.merchant-switch,.category-switch{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin:-4px auto 18px;padding:6px;background:#f1f5f9;border:1px solid var(--line);border-radius:999px;width:max-content;max-width:100%;transition:opacity .18s ease,background .18s ease,border-color .18s ease}
.merchant-switch{margin-bottom:12px}
.merchant-switch.is-loading,.category-switch.is-loading{opacity:.72;pointer-events:none}
.merchant-option,.category-option{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:0 16px;border-radius:999px;color:#475569;font-weight:850;font-size:14px;white-space:nowrap;cursor:pointer;text-decoration:none;transition:background .18s ease,color .18s ease,box-shadow .18s ease}
.merchant-option:hover,.category-option:hover{background:#e0ecff;color:var(--brand-strong)}
.merchant-option.active,.category-option.active{background:var(--brand);color:#fff;box-shadow:0 8px 18px rgba(37,99,235,.18)}
html[data-theme="dark"] .merchant-switch,html[data-theme="dark"] .category-switch{background:#111827;border-color:#334155;box-shadow:0 14px 34px rgba(0,0,0,.22)}
html[data-theme="dark"] .merchant-option,html[data-theme="dark"] .category-option{color:#cbd5e1}
html[data-theme="dark"] .merchant-option:hover,html[data-theme="dark"] .category-option:hover{background:#1e3a5f;color:#bfdbfe}
html[data-theme="dark"] .merchant-option.active,html[data-theme="dark"] .category-option.active{background:#2563eb;color:#fff;box-shadow:0 10px 24px rgba(37,99,235,.28)}
@media(max-width:575.98px){.merchant-switch,.category-switch{justify-content:flex-start;width:100%;overflow-x:auto;flex-wrap:nowrap;border-radius:16px}.merchant-option,.category-option{flex:0 0 auto;min-height:34px;padding:0 13px;font-size:13px}}


/* v32: Product management action buttons stacked vertically */
.product-action-stack{display:inline-flex;flex-direction:column;align-items:stretch;gap:4px;min-width:54px}
.product-action-stack .btn{width:100%;padding:.22rem .5rem;line-height:1.25}
.product-action-stack form{display:block;margin:0}

/* v34: Admin product name opens public product detail in a new window */
.admin-product-name-link{display:inline-block;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;font-weight:850;color:#0f172a}
.admin-product-name-link:hover{color:#1d4ed8;text-decoration:underline;text-underline-offset:2px}
html[data-theme="dark"] .admin-product-name-link{color:#f8fafc}

.admin-page table thead th.admin-action-cell,
.admin-page table tbody td.admin-action-cell,
.admin-page table thead th:last-child,
.admin-page table tbody td:last-child{
  white-space:nowrap;
}
.admin-page table tbody td.admin-action-cell .d-inline-flex,
.admin-page table tbody td:last-child .d-inline-flex{
  flex-wrap:nowrap!important;
}

/* v38: Prevent admin action button text from wrapping */
.admin-page table tbody td.admin-action-cell .btn,
.admin-page table tbody td.admin-action-cell button,
.admin-page table tbody td.admin-action-cell a,
.admin-page table tbody td:last-child .btn,
.admin-page table tbody td:last-child button,
.admin-page table tbody td:last-child a,
.product-action-stack .btn,
.product-action-stack button,
.product-action-stack a{
  white-space:nowrap!important;
  word-break:keep-all;
}

/* v40: related products on product detail page */
.product-related-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.product-related-heading h2{margin:0;font-size:22px;font-weight:900;color:#0f172a}
.product-related-heading p{margin:6px 0 0;color:#64748b;font-size:14px;line-height:1.65}
.related-product-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.related-product-card{display:flex;flex-direction:column;justify-content:space-between;gap:14px;min-width:0;border:1px solid #edf2f7;background:#f8fafc;border-radius:16px;padding:14px;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background .16s ease}
.related-product-card:hover{transform:translateY(-2px);border-color:#bfdbfe;box-shadow:0 14px 30px rgba(15,23,42,.08);background:#fff}
.related-product-tags{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.related-product-tags span,
.related-product-tags a{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border-radius:999px;background:#eef2ff;color:#334155;font-size:12px;font-weight:850;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none}
.related-product-tags a:hover{background:#dbeafe;color:#1d4ed8;text-decoration:none}
.related-product-card h3{margin:0;font-size:16px;font-weight:900;line-height:1.35}
.related-product-card h3 a{color:#0f172a;text-decoration:none}
.related-product-card h3 a:hover{color:#1d4ed8;text-decoration:underline;text-underline-offset:2px}
.related-product-config{margin:8px 0 0!important;color:#475569!important;font-size:13px!important;line-height:1.55!important}
.related-product-card-foot{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;margin-top:auto;min-width:0}
.related-product-card-foot strong{margin-left:auto;min-width:0;color:#0f172a;font-size:14px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.related-product-link{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:28px;padding:0 10px;border-radius:9px;background:#eef5ff;color:#1d4ed8;font-size:12px;font-weight:900;text-decoration:none;white-space:nowrap}
.related-product-link:hover{background:#dbeafe;color:#1e40af}
@media(max-width:900px){.related-product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:575.98px){.product-related-heading{display:block}.related-product-grid{grid-template-columns:1fr}}
html[data-theme="dark"] .product-related-heading h2,
html[data-theme="dark"] .related-product-card h3 a,
html[data-theme="dark"] .related-product-card-foot strong{color:#f8fafc}
html[data-theme="dark"] .product-related-heading p,
html[data-theme="dark"] .related-product-config{color:#cbd5e1!important}
html[data-theme="dark"] .related-product-card{background:#0f172a;border-color:#334155}
html[data-theme="dark"] .related-product-card:hover{background:#111827;border-color:#475569;box-shadow:0 16px 34px rgba(0,0,0,.22)}
html[data-theme="dark"] .related-product-tags span,
html[data-theme="dark"] .related-product-tags a{background:#172033;color:#cbd5e1}
html[data-theme="dark"] .related-product-card h3 a:hover{color:#93c5fd}
html[data-theme="dark"] .related-product-tags a:hover{background:#1e3a5f;color:#bfdbfe}
html[data-theme="dark"] .related-product-link{background:#172033;color:#93c5fd}
html[data-theme="dark"] .related-product-link:hover{background:#1e3a5f;color:#bfdbfe}

.related-product-card-foot .stock-pill{flex:0 0 auto;white-space:nowrap}

/* 代理池列表瘦身：把协议、认证、错误摘要合并展示，减少横向列宽 */
.proxy-compact-meta{
  color:#6b7280;
  font-size:.78rem;
  line-height:1.45;
  margin-top:2px;
}
.proxy-last-error{
  max-width:220px;
}
html[data-theme="dark"] .proxy-compact-meta{
  color:#9ca3af;
}


/* Admin two-level left sidebar */
.admin-sidebar-card{display:grid;grid-template-columns:260px minmax(0,1fr);align-items:stretch;overflow:hidden;width:100%}
.admin-sidebar{background:#f8fafc;border-right:1px solid var(--line);padding:18px 14px;min-height:620px}
.admin-sidebar-title{font-size:13px;font-weight:900;letter-spacing:.08em;color:#475569;text-transform:uppercase;margin:0 6px 14px}
.admin-sidebar-nav{display:flex;flex-direction:column;gap:16px}
.admin-sidebar-group{display:flex;flex-direction:column;gap:4px}
.admin-sidebar-group-title{font-size:12px;font-weight:900;color:#94a3b8;letter-spacing:.06em;text-transform:uppercase;padding:0 10px 4px}
.admin-sidebar .nav-link{display:flex!important;align-items:center;min-height:38px;border-radius:12px;color:#475569;font-weight:850;padding:.55rem .75rem;border:1px solid transparent;background:transparent;white-space:nowrap}
.admin-sidebar .nav-link:hover{color:var(--brand);background:#eef6ff;border-color:#dbeafe}
.admin-sidebar .nav-link.active{color:#fff;background:var(--brand);border-color:var(--brand);box-shadow:0 10px 22px rgba(37,99,235,.18)}
.admin-sidebar-content{min-width:0;background:#fff;padding:18px}
.admin-sidebar-card .tab-content>.tab-pane{display:none}
.admin-sidebar-card .tab-content>.tab-pane.active{display:block}
@media(max-width:991.98px){.admin-sidebar-card{display:block}.admin-sidebar{min-height:0;border-right:0;border-bottom:1px solid var(--line);padding:14px}.admin-sidebar-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.admin-sidebar-content{padding:14px}}
@media(max-width:575.98px){.admin-sidebar-nav{grid-template-columns:1fr}.admin-sidebar .nav-link{min-height:36px}.admin-sidebar-content{padding:12px}}


/* Generic Markdown preview for notification templates */
.markdown-preview-wrap{border:1px solid #dbeafe;border-radius:12px;background:#f8fbff;overflow:hidden}
.markdown-preview-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border-bottom:1px solid #dbeafe;background:#eff6ff;color:#1e40af}
.markdown-preview-head strong{font-size:12px;font-weight:850}
.markdown-preview-head span{font-size:12px;color:#64748b}
.markdown-preview{min-height:52px;padding:10px 12px;color:#0f172a;background:#fff;white-space:pre-wrap;word-break:break-word;line-height:1.55}
.markdown-preview.is-empty:before{content:attr(data-empty);color:#94a3b8}
.markdown-preview a{color:#2563eb;text-decoration:underline;text-underline-offset:2px}
.markdown-preview code{display:inline-block;padding:1px 5px;border-radius:6px;background:#f1f5f9;color:#334155;font-size:.9em}
.markdown-preview pre{display:block;margin:.35rem 0;padding:8px 10px;border-radius:8px;background:#f1f5f9;color:#334155;white-space:pre-wrap;overflow:auto}
.markdown-preview blockquote{display:block;margin:.35rem 0;padding:6px 10px;border-left:3px solid #60a5fa;background:#f8fafc;color:#334155;border-radius:0 8px 8px 0}
html[data-theme="dark"] .markdown-preview-wrap{background:#0f172a;border-color:#334155}
html[data-theme="dark"] .markdown-preview-head{background:#172033;border-color:#334155;color:#bfdbfe}
html[data-theme="dark"] .markdown-preview-head span{color:#94a3b8}
html[data-theme="dark"] .markdown-preview{background:#111827;color:#e5edf7}
html[data-theme="dark"] .markdown-preview code,
html[data-theme="dark"] .markdown-preview pre{background:#0f172a;color:#cbd5e1}
html[data-theme="dark"] .markdown-preview blockquote{background:#0f172a;color:#cbd5e1;border-left-color:#60a5fa}

.qq-subscriber-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    object-fit: cover;
    flex: 0 0 auto;
    background: #eef2ff;
    border: 1px solid rgba(15, 23, 42, .08);
}
.qq-subscriber-avatar-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #4f46e5;
}
