:root {
  color-scheme: dark;
  --bg: #050506;
  --bg-soft: #08080a;
  --panel: #0c0c0f;
  --panel-2: #111116;
  --panel-3: #17171d;
  --border: #202027;
  --border-strong: #2b2b34;
  --text: #f5f5f7;
  --muted: #8f8f9c;
  --muted-2: #62626d;
  --accent: #7c5cff;
  --accent-light: #9b83ff;
  --accent-soft: rgba(124, 92, 255, .13);
  --green: #44d492;
  --green-soft: rgba(68, 212, 146, .11);
  --amber: #ffbd55;
  --amber-soft: rgba(255, 189, 85, .11);
  --red: #ff667d;
  --red-soft: rgba(255, 102, 125, .11);
  --blue: #5c9dff;
  --blue-soft: rgba(92, 157, 255, .11);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 244px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .45);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.danger-text { color: var(--red); }
.success-text { color: var(--green); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #28282f; border: 2px solid transparent; border-radius: 8px; background-clip: padding-box; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 28px; overflow: hidden; position: relative; }
.login-glow { position: absolute; width: 520px; height: 520px; border-radius: 999px; filter: blur(120px); opacity: .12; pointer-events: none; }
.login-glow-one { top: -260px; left: -180px; background: var(--accent); }
.login-glow-two { bottom: -320px; right: -160px; background: #245bff; }
.login-card { width: min(100%, 440px); padding: 42px; background: rgba(12, 12, 15, .9); border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow); position: relative; backdrop-filter: blur(24px); }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; font-weight: 900; color: white; background: linear-gradient(145deg, var(--accent-light), #6745f3); box-shadow: 0 8px 22px rgba(124, 92, 255, .28); flex: 0 0 auto; }
.brand-mark-large { width: 54px; height: 54px; border-radius: 16px; font-size: 26px; margin-bottom: 25px; }
.eyebrow { color: var(--accent-light); font-size: 11px; letter-spacing: .16em; font-weight: 800; }
.login-card h1 { font-size: 31px; letter-spacing: -.04em; margin: 8px 0 10px; }
.login-card > p { margin: 0 0 30px; color: var(--muted); max-width: 330px; }
.login-security { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 24px; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 9px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #08080a; border-right: 1px solid #17171b; padding: 20px 14px; display: flex; flex-direction: column; z-index: 30; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 24px; }
.sidebar-brand strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.sidebar-brand span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; letter-spacing: .08em; text-transform: uppercase; }
.side-nav { display: grid; gap: 5px; }
.side-nav-bottom { padding-top: 10px; border-top: 1px solid var(--border); }
.sidebar-spacer { flex: 1; }
.nav-item { position: relative; width: 100%; min-height: 44px; border: 0; border-radius: 12px; display: flex; align-items: center; gap: 12px; padding: 0 12px; color: #a7a7b3; background: transparent; cursor: pointer; text-align: left; transition: .18s ease; }
.nav-item:hover { color: var(--text); background: #101014; }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(124,92,255,.17), rgba(124,92,255,.07)); }
.nav-item.active::before { content: ""; width: 3px; height: 20px; position: absolute; left: -2px; border-radius: 5px; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.nav-item svg { width: 19px; height: 19px; stroke-width: 1.8; flex: 0 0 auto; }
.nav-item span { flex: 1; }
.nav-badge { min-width: 21px; height: 21px; border-radius: 7px; display: grid; place-items: center; padding: 0 6px; background: var(--accent); color: white; font-size: 10px; }
.nav-badge.subtle { background: var(--panel-3); color: var(--muted); }
.sidebar-account { margin-top: 14px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); display: flex; gap: 10px; align-items: center; min-height: 62px; }
.account-mini-avatar { width: 34px; height: 34px; border-radius: 11px; background: var(--panel-3); display: grid; place-items: center; font-weight: 800; color: var(--accent-light); flex: 0 0 auto; overflow: hidden; }
.account-mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-account strong { display: block; max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.sidebar-account small { color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 10px; }

.main-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { height: 82px; padding: 0 clamp(20px, 3vw, 42px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #131317; background: rgba(5,5,6,.9); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(18px); }
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title h1 { font-size: 20px; letter-spacing: -.035em; margin: 0; }
.topbar-title p { color: var(--muted); margin: 3px 0 0; font-size: 12px; }
.mobile-brand { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.sync-state { display: flex; align-items: center; gap: 8px; padding: 8px 11px; color: var(--muted); font-size: 11px; border: 1px solid var(--border); border-radius: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex: 0 0 auto; }
.status-dot.ok { background: var(--green); box-shadow: 0 0 10px rgba(68,212,146,.45); }
.status-dot.error { background: var(--red); box-shadow: 0 0 10px rgba(255,102,125,.35); }
.status-dot.warning { background: var(--amber); }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 11px; background: var(--panel); cursor: pointer; transition: .18s ease; }
.icon-button:hover { border-color: var(--border-strong); background: var(--panel-2); }
.icon-button svg { width: 18px; height: 18px; }
.icon-button.spinning svg { animation: spin .8s linear infinite; }
.avatar-button { width: 38px; height: 38px; padding: 0; border-radius: 12px; border: 1px solid var(--border-strong); background: linear-gradient(145deg, #24242d, #141419); cursor: pointer; font-weight: 800; color: var(--accent-light); overflow: hidden; }
.avatar-button img { width: 100%; height: 100%; object-fit: cover; }
.view-root { padding: 28px clamp(20px, 3vw, 42px) 54px; max-width: 1540px; margin: 0 auto; }
.security-warning { margin: 18px clamp(20px, 3vw, 42px) 0; padding: 12px 15px; border: 1px solid rgba(255,189,85,.24); background: var(--amber-soft); color: #ffd594; border-radius: 12px; font-size: 12px; display: flex; align-items: center; gap: 10px; }
.security-warning svg { width: 18px; height: 18px; flex: 0 0 auto; }
.bottom-nav { display: none; }

.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-actions-group { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.search-box { width: min(380px, 100%); height: 42px; border: 1px solid var(--border); background: var(--panel); border-radius: 12px; display: flex; align-items: center; padding: 0 13px; gap: 9px; transition: .18s ease; }
.search-box:focus-within { border-color: rgba(124,92,255,.55); box-shadow: 0 0 0 3px rgba(124,92,255,.08); }
.search-box svg { width: 17px; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; min-width: 0; }
.search-box input::placeholder, textarea::placeholder, input::placeholder { color: #5d5d68; }
.button { min-height: 39px; border-radius: 11px; border: 1px solid var(--border); padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; font-size: 12px; cursor: pointer; transition: .18s ease; background: var(--panel-2); color: var(--text); }
.button:hover { transform: translateY(-1px); border-color: var(--border-strong); background: var(--panel-3); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button svg { width: 16px; height: 16px; }
.button-primary { background: var(--accent); border-color: var(--accent); color: white; box-shadow: 0 9px 25px rgba(124,92,255,.18); }
.button-primary:hover { background: #896cff; border-color: #896cff; }
.button-secondary { background: var(--panel); }
.button-ghost { background: transparent; }
.button-danger { color: var(--red); border-color: rgba(255,102,125,.25); background: var(--red-soft); }
.button-large { min-height: 47px; border-radius: 13px; width: 100%; font-size: 13px; }
.button-small { min-height: 32px; padding: 0 11px; font-size: 11px; border-radius: 9px; }
.segmented { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--border); background: var(--panel); border-radius: 13px; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.chip { min-height: 32px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; font-size: 11px; font-weight: 650; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--panel-3); color: white; box-shadow: inset 0 0 0 1px var(--border-strong); }
.chip-count { margin-left: 5px; color: var(--muted-2); }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-header { min-height: 63px; padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.panel-subtitle { color: var(--muted); font-size: 11px; margin-top: 3px; }
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 790px; }
.data-table th { height: 45px; padding: 0 16px; color: var(--muted); text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; border-bottom: 1px solid var(--border); }
.data-table td { min-height: 68px; padding: 13px 16px; border-bottom: 1px solid #18181d; vertical-align: middle; }
.data-table tbody tr { cursor: pointer; transition: .15s ease; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #101014; }
.order-product { display: flex; gap: 11px; align-items: center; min-width: 250px; }
.product-thumb-small { width: 42px; height: 42px; border-radius: 11px; background: var(--panel-3); object-fit: cover; flex: 0 0 auto; border: 1px solid var(--border); }
.order-product strong, .cell-main { display: block; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.cell-sub { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.price-cell { font-weight: 750; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 0 9px; border-radius: 8px; font-size: 10px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-green { color: var(--green); background: var(--green-soft); border-color: rgba(68,212,146,.13); }
.status-blue { color: var(--blue); background: var(--blue-soft); border-color: rgba(92,157,255,.13); }
.status-amber { color: var(--amber); background: var(--amber-soft); border-color: rgba(255,189,85,.13); }
.status-red { color: var(--red); background: var(--red-soft); border-color: rgba(255,102,125,.13); }
.status-purple { color: var(--accent-light); background: var(--accent-soft); border-color: rgba(124,92,255,.15); }
.status-gray { color: var(--muted); background: rgba(143,143,156,.08); border-color: rgba(143,143,156,.1); }
.order-mobile-list { display: none; }

.empty-state { min-height: 330px; display: grid; place-items: center; text-align: center; padding: 45px 20px; }
.empty-icon { width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center; margin: 0 auto 16px; background: var(--panel-3); color: var(--muted); }
.empty-icon svg { width: 25px; height: 25px; }
.empty-state h3 { font-size: 15px; margin: 0 0 7px; }
.empty-state p { color: var(--muted); margin: 0; max-width: 320px; }
.loader { min-height: 300px; display: grid; place-items: center; }
.spinner { width: 27px; height: 27px; border-radius: 50%; border: 2px solid #24242b; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.messages-page { height: calc(100vh - 138px); min-height: 560px; }
.messages-layout { height: 100%; display: grid; grid-template-columns: minmax(300px, 365px) 1fr; overflow: hidden; }
.chat-list-pane { border-right: 1px solid var(--border); min-width: 0; display: flex; flex-direction: column; }
.chat-list-toolbar { padding: 15px; border-bottom: 1px solid var(--border); display: grid; gap: 11px; }
.chat-list-toolbar .search-box { width: 100%; }
.chat-filter-row { display: flex; flex-wrap: wrap; gap: 6px; overflow: visible; }
.chat-filter-row::-webkit-scrollbar { display: none; }
.chat-filter { border: 0; background: transparent; color: var(--muted); padding: 7px 9px; border-radius: 8px; white-space: nowrap; cursor: pointer; font-size: 12px; }
.chat-filter.active { color: white; background: var(--panel-3); }
.chat-list { overflow-y: auto; flex: 1; }
.chat-row { width: 100%; border: 0; border-bottom: 1px solid #18181d; padding: 13px 14px; background: transparent; cursor: pointer; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 11px; text-align: left; transition: .15s; }
.chat-row:hover, .chat-row.active { background: #111115; }
.chat-row.active { box-shadow: inset 3px 0 var(--accent); }
.chat-avatar { width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(145deg,#20202a,#141419); display: grid; place-items: center; font-weight: 800; color: var(--accent-light); overflow: hidden; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-main { min-width: 0; }
.chat-name-row { display: flex; align-items: center; gap: 7px; }
.chat-name { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-preview { color: var(--muted); font-size: 10px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-product { color: var(--muted-2); font-size: 9px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meta { display: grid; justify-items: end; align-content: start; gap: 7px; }
.chat-time { color: var(--muted-2); font-size: 9px; white-space: nowrap; }
.unread-badge { min-width: 18px; height: 18px; border-radius: 7px; padding: 0 5px; display: grid; place-items: center; background: var(--accent); font-size: 9px; font-weight: 800; }
.conversation-pane { min-width: 0; display: flex; flex-direction: column; background: #09090b; }
.conversation-empty { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; }
.conversation-header { min-height: 66px; padding: 11px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 11px; background: var(--panel); }
.conversation-header-main { min-width: 0; flex: 1; }
.conversation-header-main strong { display: block; }
.conversation-header-main small { color: var(--muted); display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-chat-back { display: none; }
.message-feed { flex: 1; overflow-y: auto; padding: 24px clamp(16px,3vw,38px); display: flex; flex-direction: column; gap: 9px; }
.message-row { display: flex; }
.message-row.own { justify-content: flex-end; }
.message-bubble { max-width: min(68%, 620px); padding: 10px 12px 8px; border-radius: 14px 14px 14px 4px; background: var(--panel-3); border: 1px solid var(--border); }
.message-row.own .message-bubble { background: #261e4d; border-color: rgba(124,92,255,.28); border-radius: 14px 14px 4px 14px; }
.message-text { white-space: pre-wrap; word-break: break-word; font-size: 12px; }
.message-images { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5px; margin-bottom: 7px; }
.message-images img { width: 100%; max-height: 280px; object-fit: cover; border-radius: 9px; cursor: zoom-in; }
.message-time { color: rgba(255,255,255,.42); text-align: right; font-size: 8px; margin-top: 5px; }
.composer { padding: 12px 15px calc(12px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--border); }
.composer-form { display: flex; gap: 9px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; max-height: 130px; min-height: 42px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 13px; outline: 0; background: var(--panel-2); color: var(--text); }
.composer textarea:focus { border-color: rgba(124,92,255,.5); }
.composer-attach, .composer-send { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); display: grid; place-items: center; cursor: pointer; }
.composer-send { border-color: var(--accent); background: var(--accent); }
.composer-attach svg, .composer-send svg { width: 18px; }
.upload-preview { color: var(--accent-light); font-size: 10px; padding: 0 52px 8px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.product-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: .18s ease; display: flex; flex-direction: column; }
.product-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 14px 40px rgba(0,0,0,.22); }
.product-cover { aspect-ratio: 16/8.5; background: linear-gradient(145deg,#15151b,#0c0c10); position: relative; overflow: hidden; }
.product-cover img { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: .35s ease; }
.product-card:hover .product-cover img { transform: scale(1.025); }
.product-cover::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(5,5,6,.75)); }
.product-status { position: absolute; top: 11px; left: 11px; z-index: 2; }
.product-menu { position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 11px; border: 1px solid rgba(255,255,255,.13); background: rgba(8,8,10,.75); backdrop-filter: blur(12px); display: grid; place-items: center; cursor: pointer; }
.product-body { padding: 15px; display: flex; flex: 1; flex-direction: column; }
.product-category { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; min-height: 14px; }
.category-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.product-name { font-size: 13px; font-weight: 720; line-height: 1.38; min-height: 38px; margin-bottom: 14px; }
.product-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.product-price { font-size: 19px; font-weight: 800; letter-spacing: -.03em; }
.product-stats { color: var(--muted); font-size: 9px; display: flex; gap: 10px; margin-top: 4px; }
.automation-indicators { display: flex; gap: 5px; }
.automation-indicator { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--panel-3); color: var(--muted-2); }
.automation-indicator.active { background: var(--accent-soft); color: var(--accent-light); }
.automation-indicator svg { width: 14px; height: 14px; }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 14px; }
.template-card { padding: 18px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.template-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.template-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-light); }
.template-icon svg { width: 18px; }
.template-card h3 { font-size: 13px; margin: 13px 0 5px; }
.template-product { color: var(--muted); font-size: 10px; }
.template-message { margin: 14px 0; padding: 12px; min-height: 64px; border-radius: 11px; background: var(--panel-2); color: #c6c6ce; font-size: 11px; white-space: pre-wrap; }
.template-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.switch { position: relative; width: 38px; height: 22px; display: inline-block; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: #292931; border-radius: 30px; cursor: pointer; transition: .2s; }
.switch-track::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #858591; border-radius: 50%; transition: .2s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(16px); background: white; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { padding: 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; min-width: 0; }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }
.metric-icon { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-3); color: var(--accent-light); }
.metric-icon svg { width: 15px; }
.metric-value { font-size: clamp(20px,2vw,28px); letter-spacing: -.045em; font-weight: 800; margin-top: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-note { color: var(--muted-2); font-size: 9px; margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px,.8fr); gap: 14px; margin-bottom: 14px; }
.chart-panel { padding: 18px; min-height: 345px; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.chart-head h3 { margin: 0; font-size: 13px; }
.chart-head p { color: var(--muted); margin: 4px 0 0; font-size: 10px; }
.orders-chart-wrap { position: relative; }
.orders-chart { width: 100%; height: 245px; overflow: visible; }
.chart-grid-line { stroke: #1d1d23; stroke-width: 1; }
.chart-area { fill: url(#chartGradient); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-hit { fill: transparent; cursor: crosshair; outline: none; }
.chart-point { fill: var(--bg); stroke: var(--accent-light); stroke-width: 2.5; pointer-events: none; transition: r .16s ease, fill .16s ease; }
.chart-hit:hover + .chart-point, .chart-hit:focus + .chart-point { fill: var(--accent); r: 6px; }
.chart-label { fill: var(--muted-2); font-size: 10px; }
.chart-tooltip { position: absolute; z-index: 8; min-width: 150px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 11px; background: rgba(20,20,25,.98); box-shadow: 0 12px 32px rgba(0,0,0,.38); transform: translate(-50%,-100%); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .14s ease, visibility .14s ease; }
.chart-tooltip.visible { opacity: 1; visibility: visible; }
.chart-tooltip strong, .chart-tooltip span, .chart-tooltip small { display: block; }
.chart-tooltip strong { font-size: 12px; }
.chart-tooltip span { margin-top: 3px; color: var(--text); font-size: 13px; font-weight: 750; }
.chart-tooltip small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.publication-panel { padding: 18px; }
.publication-list { display: grid; gap: 2px; margin-top: 14px; }
.publication-row { min-height: 51px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.publication-row:last-child { border: 0; }
.publication-row > .publication-label { color: var(--muted); font-size: 11px; display: inline-flex; align-items: center; gap: 7px; }
.publication-label .help-popover { left: auto; right: 0; }
.publication-row strong { font-size: 13px; }
.stats-lower-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; }
.history-list { display: grid; }
.history-item { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 66px; padding: 10px 17px; border-bottom: 1px solid var(--border); }
.history-item:last-child { border-bottom: 0; }
.history-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--panel-3); color: var(--accent-light); }
.history-icon svg { width: 16px; }
.history-item strong { font-size: 11px; display: block; }
.history-item p { margin: 4px 0 0; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-amount { text-align: right; font-size: 11px; font-weight: 700; }
.history-amount small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }

.profile-hero { padding: 22px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 18px; align-items: center; margin-bottom: 14px; }
.profile-avatar { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(145deg,#282835,#121217); color: var(--accent-light); font-size: 25px; font-weight: 900; border: 1px solid var(--border-strong); overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-main { min-width: 0; }
.profile-main h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.profile-username { color: var(--muted); margin-top: 4px; }
.profile-rating { margin-top: 11px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 9px; background: var(--amber-soft); color: var(--amber); padding: 6px 9px; cursor: pointer; font-size: 10px; }
.profile-proxy { min-width: 210px; padding: 14px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--border); }
.profile-proxy-label { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.profile-proxy-state { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-weight: 700; font-size: 11px; }
.profile-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.profile-stat { padding: 16px; border-radius: 15px; background: var(--panel); border: 1px solid var(--border); }
.profile-stat span { color: var(--muted); font-size: 10px; }
.profile-stat strong { display: block; font-size: 20px; margin-top: 8px; letter-spacing: -.03em; }
.balance-panel { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; margin-bottom: 14px; }
.balance-item { padding: 20px; }
.balance-item + .balance-item { border-left: 1px solid var(--border); }
.balance-item span { color: var(--muted); font-size: 10px; }
.balance-item strong { display: block; margin-top: 7px; font-size: 23px; }
.accounts-panel { overflow: hidden; }
.account-row { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.account-row:last-child { border-bottom: 0; }
.account-row h4 { margin: 0; font-size: 12px; }
.account-row p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.account-row-actions { display: flex; align-items: center; gap: 8px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.72); display: grid; place-items: center; padding: 18px; backdrop-filter: blur(9px); animation: fade-in .16s ease; }
.modal { width: min(100%, 560px); max-height: min(90vh, 850px); overflow: auto; background: #0d0d10; border: 1px solid var(--border-strong); border-radius: 21px; box-shadow: var(--shadow); animation: modal-in .18s ease; }
.modal-wide { width: min(100%, 760px); }
.modal-head { min-height: 66px; padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: rgba(13,13,16,.96); backdrop-filter: blur(15px); z-index: 3; }
.modal-head h2 { margin: 0; font-size: 15px; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.modal-body { padding: 19px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; padding: 15px 19px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: rgba(13,13,16,.96); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }

.stack-form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-group { display: grid; gap: 7px; min-width: 0; }
.form-group.full { grid-column: 1/-1; }
.field-label { color: #c3c3cb; font-size: 10px; font-weight: 650; }
.field-hint { color: var(--muted); font-size: 9px; line-height: 1.5; }
input, select, textarea { width: 100%; border: 1px solid var(--border); background: var(--panel-2); border-radius: 11px; color: var(--text); outline: 0; transition: .18s; }
input, select { height: 42px; padding: 0 12px; }
textarea { min-height: 112px; padding: 11px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(124,92,255,.55); box-shadow: 0 0 0 3px rgba(124,92,255,.08); }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-field .icon-button { position: absolute; right: 3px; top: 3px; width: 36px; height: 36px; border: 0; background: transparent; }
.form-section { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: #0a0a0d; }
.form-section-title { font-size: 11px; font-weight: 750; margin-bottom: 11px; display: flex; align-items: center; justify-content: space-between; }
.form-section-title span { color: var(--muted); font-size: 9px; font-weight: 500; }
.toggle-row { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toggle-row + .toggle-row { border-top: 1px solid var(--border); }
.toggle-row strong { display: block; font-size: 11px; }
.toggle-row p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.info-callout { padding: 11px 13px; border-radius: 11px; color: #aeb5d0; background: var(--blue-soft); border: 1px solid rgba(92,157,255,.14); font-size: 9px; line-height: 1.55; }
.automation-form .form-section-title { font-size: 14px; }
.automation-form .form-section-title > span { font-size: 12px; }
.automation-form .toggle-row strong { font-size: 14px; }
.automation-form .toggle-row p { font-size: 12px; line-height: 1.45; }
.automation-form .field-label { font-size: 13px; }
.automation-form input, .automation-form select { font-size: 14px; }
.automation-form .automation-safety-hint { margin: 10px 0 0; padding: 11px 12px; border-left: 3px solid var(--accent); border-radius: 0 9px 9px 0; background: var(--accent-soft); color: #c9c1f7; font-size: 13px; line-height: 1.55; }
.automation-form .info-callout { padding: 13px 15px; font-size: 13px; line-height: 1.55; }
.telegram-settings-section { display: grid; gap: 12px; }
.telegram-settings-section > .form-section-title { margin-bottom: 0; }
.telegram-chat-field { padding-top: 3px; }
.notification-event-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.notification-event-grid .toggle-row.compact { min-height: 92px; padding: 11px; align-items: flex-start; border: 1px solid var(--border); border-radius: 11px; background: var(--panel-2); }
.notification-event-grid .toggle-row.compact + .toggle-row.compact { border-top: 1px solid var(--border); }
.notification-event-grid .toggle-row.compact > div { min-width: 0; }
.warning-callout { color: #e6c080; border-color: rgba(255,189,85,.18); background: var(--amber-soft); }
.modal-action-spacer { flex: 1; }

.section-intro-with-help, .field-label-with-help { display: flex; align-items: center; gap: 8px; }
.help-tip { position: relative; width: 20px; height: 20px; flex: 0 0 auto; display: inline-grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--panel-2); color: var(--accent-light); font: 800 12px/1 Inter, ui-sans-serif, system-ui, sans-serif; cursor: help; outline: none; }
.help-tip:hover, .help-tip:focus { border-color: rgba(124,92,255,.65); background: var(--accent-soft); color: white; }
.help-popover { position: absolute; z-index: 100; top: calc(100% + 9px); left: 0; width: min(310px, calc(100vw - 40px)); padding: 13px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: #17171d; color: #d8d8df; box-shadow: 0 16px 45px rgba(0,0,0,.46); font: 500 12px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; text-align: left; opacity: 0; visibility: hidden; transform: translateY(-3px); transition: .15s ease; pointer-events: none; }
.help-tip:hover .help-popover, .help-tip:focus .help-popover, .help-tip:focus-within .help-popover { opacity: 1; visibility: visible; transform: translateY(0); }
.help-popover > strong { display: block; margin-bottom: 8px; color: white; font-size: 13px; }
.help-line { display: grid; grid-template-columns: 78px 1fr; gap: 8px; align-items: baseline; }
.help-line + .help-line { margin-top: 5px; }
.help-line code { color: var(--accent-light); font: 700 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-item { padding: 12px; border-radius: 11px; background: var(--panel-2); }
.detail-item span { display: block; color: var(--muted); font-size: 9px; }
.detail-item strong { display: block; font-size: 11px; margin-top: 6px; word-break: break-word; }
.review-list { display: grid; gap: 10px; }
.review-card { padding: 13px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-stars { color: var(--amber); letter-spacing: 1px; }
.review-card p { margin: 9px 0 7px; color: #ceced5; font-size: 11px; }
.review-card small { color: var(--muted); font-size: 9px; }

.toast-root { position: fixed; top: 18px; right: 18px; z-index: 200; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: rgba(19,19,23,.96); box-shadow: 0 15px 45px rgba(0,0,0,.4); display: grid; grid-template-columns: 7px 1fr; gap: 10px; align-items: start; animation: toast-in .2s ease; backdrop-filter: blur(15px); }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; background: var(--accent); }
.toast.success::before { background: var(--green); }
.toast.error::before { background: var(--red); }
.toast strong { display: block; font-size: 11px; }
.toast p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
@keyframes toast-in { from { transform: translateX(15px); opacity: 0; } }

/* Overview and completed application states */
.overview-hero { position: relative; min-height: 158px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 24px; padding: 25px 27px; margin-bottom: 15px; overflow: hidden; border-color: rgba(124,92,255,.22); background: linear-gradient(120deg,rgba(124,92,255,.13),rgba(124,92,255,.035) 58%,rgba(92,157,255,.06)); }
.overview-hero::after { content: ""; position: absolute; right: -110px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle,rgba(124,92,255,.17),transparent 68%); pointer-events: none; }
.overview-hero-copy { position: relative; z-index: 1; }
.eyebrow { color: var(--accent-light); font-size: 10px; letter-spacing: .15em; font-weight: 800; }
.overview-hero h2 { margin: 8px 0 7px; font-size: clamp(25px,3vw,34px); line-height: 1.08; letter-spacing: -.045em; }
.overview-hero p { max-width: 650px; margin: 0; color: var(--muted); font-size: 13px; }
.overview-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.overview-balance { position: relative; z-index: 1; min-width: 220px; padding: 16px 17px; border: 1px solid rgba(255,255,255,.09); border-radius: 15px; background: rgba(8,8,10,.62); backdrop-filter: blur(12px); }
.overview-balance span { color: var(--muted); font-size: 11px; }
.overview-balance strong { display: block; margin-top: 7px; font-size: 22px; letter-spacing: -.035em; }
.overview-balance small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.overview-balance .status-dot { position: absolute; top: 16px; right: 16px; }
.overview-history { margin-top: 14px; overflow: hidden; }
.section-intro { max-width: 780px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.product-filter-bar { width: fit-content; max-width: 100%; margin-bottom: 15px; }
.products-root { min-height: 240px; }
.product-cover-fallback { position: absolute; z-index: 0; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; background: radial-gradient(circle at 75% 10%,rgba(124,92,255,.36),transparent 42%),linear-gradient(145deg,#20202a,#0c0c10); }
.product-cover-fallback span { color: white; font-size: 28px; font-weight: 900; letter-spacing: -.05em; }
.product-cover-fallback small { color: rgba(255,255,255,.52); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.thumbnail-fallback { display: grid; place-items: center; color: var(--accent-light); background: linear-gradient(145deg,#282834,#141419); font-size: 10px; font-weight: 850; }
.product-rule-grid { margin-top: 12px; }
.template-actions { display: flex; gap: 6px; }
.template-actions .icon-button { width: 34px; height: 34px; }
.stats-product-panel { margin-bottom: 14px; overflow: hidden; }
.stats-history-panel { overflow: hidden; }
.history-panel-head { min-height: 72px; flex-wrap: wrap; }
.history-panel-head .segmented { max-width: 100%; }
.profile-date-value { font-size: 16px !important; }
.profile-footer-actions { display: flex; justify-content: flex-end; padding-top: 14px; }
.account-row p { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.account-row-avatar { width: 44px; height: 44px; border-radius: 13px; }
.connection-test-result { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); background: var(--panel-2); font-size: 11px; }
.connection-test-result.success { color: var(--green); border-color: rgba(68,212,146,.22); background: var(--green-soft); }
.connection-test-result.error { color: var(--red); border-color: rgba(255,102,125,.22); background: var(--red-soft); }
.image-preview { display: grid; place-items: center; min-height: 280px; padding: 15px; background: #070708; }
.image-preview img { max-width: 100%; max-height: 72vh; border-radius: 12px; object-fit: contain; }
.empty-action { margin-top: 18px; }
.button.spinning svg { animation: spin .8s linear infinite; }

/* Slightly larger type for long daily sessions */
body { font-size: 15px; }
.nav-item { font-size: 13px; }
.sidebar-account strong { font-size: 13px; }
.sidebar-account small { font-size: 11px; }
.topbar-title h1 { font-size: 22px; }
.topbar-title p { font-size: 13px; }
.sync-state { font-size: 12px; }
.button { font-size: 13px; }
.button-small { font-size: 11px; }
.chip { font-size: 12px; }
.search-box input { font-size: 13px; }
.panel-title { font-size: 15px; }
.panel-subtitle { font-size: 12px; }
.data-table th { font-size: 11px; }
.cell-main, .order-product strong { font-size: 13px; }
.cell-sub { font-size: 11px; }
.status-badge { font-size: 11px; }
.chat-name { font-size: 13px; }
.chat-preview { font-size: 11px; }
.chat-product { font-size: 10px; }
.chat-time { font-size: 10px; }
.conversation-header-main small { font-size: 11px; }
.message-text { font-size: 13px; }
.message-time { font-size: 9px; }
.product-category { font-size: 10px; }
.product-name { font-size: 14px; }
.product-stats { font-size: 10px; }
.template-card h3 { font-size: 14px; }
.template-product { font-size: 11px; }
.template-message { font-size: 12px; }
.metric-head { font-size: 11px; }
.metric-note { font-size: 10px; }
.chart-head h3 { font-size: 14px; }
.chart-head p { font-size: 11px; }
.publication-row span { font-size: 12px; }
.history-item strong { font-size: 12px; }
.history-item p { font-size: 10px; }
.profile-username { font-size: 12px; }
.profile-rating { font-size: 11px; }
.profile-stat span, .balance-item span { font-size: 11px; }
.account-row h4 { font-size: 13px; }
.account-row p { font-size: 11px; }
.modal-head h2 { font-size: 17px; }
.modal-head p { font-size: 11px; }
.field-label { font-size: 11px; }
.field-hint { font-size: 10px; }
input, select, textarea { font-size: 13px; }
.toggle-row strong { font-size: 12px; }
.toggle-row p { font-size: 10px; }
.info-callout { font-size: 10px; }
.toast strong { font-size: 12px; }
.toast p { font-size: 11px; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stats-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-hero { grid-template-columns: 1fr; }
  .overview-balance { width: min(100%,360px); }
}

@media (max-width: 820px) {
  :root { --bottom-nav: 68px; }
  body { padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .main-shell { margin-left: 0; }
  .topbar { height: 66px; padding: 0 14px; }
  .mobile-brand { display: grid; width: 34px; height: 34px; border-radius: 11px; font-size: 17px; }
  .topbar-title h1 { font-size: 17px; }
  .topbar-title p, .sync-state, .top-action { display: none; }
  .avatar-button { width: 35px; height: 35px; }
  .view-root { padding: 16px 12px 26px; }
  .security-warning { margin: 12px 12px 0; }
  .bottom-nav { position: fixed; z-index: 50; inset: auto 0 0; height: calc(var(--bottom-nav) + env(safe-area-inset-bottom)); padding: 7px 6px env(safe-area-inset-bottom); background: rgba(9,9,11,.96); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5,1fr); backdrop-filter: blur(18px); }
  .bottom-nav-item { position: relative; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 3px; font-size: 9px; border-radius: 10px; cursor: pointer; }
  .bottom-nav-item svg { width: 19px; height: 19px; }
  .bottom-nav-item.active { color: var(--accent-light); background: var(--accent-soft); }
  .mobile-badge { position: absolute; top: 1px; right: calc(50% - 20px); min-width: 16px; height: 16px; border-radius: 6px; display: grid; place-items: center; font-size: 8px; background: var(--red); color: white; }
  .page-actions { align-items: stretch; flex-direction: column; margin-bottom: 14px; }
  .page-actions-group { width: 100%; }
  .page-actions-group .search-box { flex: 1; }
  .segmented { width: 100%; }
  .data-table { display: none; }
  .order-mobile-list { display: grid; }
  .order-mobile-card { padding: 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
  .order-mobile-card:last-child { border: 0; }
  .order-mobile-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
  .order-mobile-product { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .order-mobile-product strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .order-mobile-meta { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .order-mobile-meta span { color: var(--muted); font-size: 10px; }
  .messages-page { height: calc(100dvh - 151px); min-height: 440px; margin: -16px -12px -26px; border-radius: 0; border-inline: 0; }
  .messages-layout { grid-template-columns: 1fr; }
  .chat-list-pane { border-right: 0; }
  .conversation-pane { display: none; }
  .messages-layout.chat-open .chat-list-pane { display: none; }
  .messages-layout.chat-open .conversation-pane { display: flex; }
  .mobile-chat-back { display: grid; }
  .message-bubble { max-width: 84%; }
  .message-feed { padding: 17px 12px; }
  .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .product-card { border-radius: 14px; }
  .product-cover { aspect-ratio: 16/10; }
  .product-body { padding: 11px; }
  .product-name { font-size: 12px; min-height: 35px; margin-bottom: 10px; }
  .product-price { font-size: 16px; }
  .product-stats { display: none; }
  .automation-indicator { width: 24px; height: 24px; }
  .template-grid { grid-template-columns: 1fr; }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 14px; border-radius: 14px; }
  .metric-value { font-size: 20px; }
  .chart-panel { min-height: 290px; padding: 14px; }
  .orders-chart { height: 205px; }
  .profile-hero { grid-template-columns: auto 1fr; padding: 16px; gap: 13px; }
  .profile-avatar { width: 58px; height: 58px; border-radius: 17px; }
  .profile-main h2 { font-size: 16px; }
  .profile-proxy { grid-column: 1/-1; min-width: 0; }
  .profile-grid { gap: 8px; }
  .profile-stat { padding: 13px; }
  .profile-stat strong { font-size: 17px; }
  .balance-item { padding: 15px; }
  .balance-item strong { font-size: 18px; }
  .account-row { grid-template-columns: 40px 1fr; padding: 13px; }
  .account-row-actions { grid-column: 1/-1; justify-content: stretch; }
  .account-row-actions .button { flex: 1; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .modal-wide { width: 100%; }
  .modal-body { padding: 16px; }
  .modal-actions { flex-wrap: wrap; padding-bottom: calc(15px + env(safe-area-inset-bottom)); }
  .modal-actions .modal-action-spacer { display: none; }
  .modal-actions #test-telegram-button { margin-right: auto; }
  .notification-event-grid { grid-template-columns: 1fr; }
  .notification-event-grid .toggle-row.compact { min-height: 68px; }
  .help-popover { position: fixed; inset: auto 12px calc(var(--bottom-nav) + 12px + env(safe-area-inset-bottom)) 12px; width: auto; transform: translateY(5px); }
  .publication-label .help-popover { inset: auto 12px calc(var(--bottom-nav) + 12px + env(safe-area-inset-bottom)) 12px; }
  .help-tip:hover .help-popover, .help-tip:focus .help-popover, .help-tip:focus-within .help-popover { transform: translateY(0); }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .toast-root { top: 10px; right: 10px; width: calc(100vw - 20px); }
  .overview-hero { min-height: 0; padding: 20px; border-radius: 17px; }
  .overview-hero h2 { font-size: 25px; }
  .overview-hero p { font-size: 12px; }
  .overview-links .button { flex: 1; }
  .overview-balance { width: 100%; min-width: 0; }
  .history-panel-head { align-items: flex-start; }
  .history-panel-head .segmented { width: 100%; }
}

@media (max-width: 430px) {
  .login-view { padding: 14px; }
  .login-card { padding: 28px 22px; border-radius: 22px; }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .product-category { font-size: 8px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-head > span:first-child { max-width: 78px; }
}

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