@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&family=Unbounded:wght@500;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-1: #060a18;
  --bg-2: #0e1e44;
  --panel: rgba(12, 20, 49, 0.72);
  --panel-2: rgba(14, 28, 68, 0.66);
  --line: rgba(133, 165, 255, 0.28);
  --text: #e6eeff;
  --muted: #a5b7e7;
  --neon: #15d1ff;
  --accent: #6d78ff;
  --ok: #23e2b2;
  --danger: #ff476f;
  --bg-radial-a: rgba(39, 83, 201, 0.55);
  --bg-radial-b: rgba(109, 67, 207, 0.55);
  --field-bg: rgba(7, 13, 32, 0.82);
  --field-placeholder: #93a6d8;
}

body[data-theme="classic"] {
  --bg-1: #060a18;
  --bg-2: #0e1e44;
  --panel: rgba(12, 20, 49, 0.72);
  --panel-2: rgba(14, 28, 68, 0.66);
  --line: rgba(133, 165, 255, 0.28);
  --text: #e6eeff;
  --muted: #a5b7e7;
  --neon: #15d1ff;
  --accent: #6d78ff;
  --ok: #23e2b2;
  --danger: #ff476f;
}

body[data-theme="dark"] {
  --bg-1: #05070f;
  --bg-2: #101828;
  --panel: rgba(18, 23, 35, 0.85);
  --panel-2: rgba(20, 28, 42, 0.78);
  --line: rgba(146, 168, 214, 0.25);
  --text: #edf2ff;
  --muted: #9fb2d8;
  --neon: #28c7ff;
  --accent: #5f89ff;
  --ok: #3de3a5;
  --danger: #ff517a;
}

body[data-theme="light"] {
  --bg-1: #eef4ff;
  --bg-2: #cedfff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-2: rgba(241, 247, 255, 0.94);
  --line: rgba(77, 109, 171, 0.35);
  --text: #102848;
  --muted: #375681;
  --neon: #0b9dd6;
  --accent: #4666cc;
  --ok: #0d9f74;
  --danger: #c93056;
  --bg-radial-a: rgba(97, 156, 255, 0.28);
  --bg-radial-b: rgba(90, 117, 211, 0.25);
  --field-bg: rgba(255, 255, 255, 0.98);
  --field-placeholder: #5f7fa9;
}

body[data-theme="moon"] {
  --bg-1: #12161f;
  --bg-2: #2f3648;
  --panel: rgba(33, 39, 55, 0.86);
  --panel-2: rgba(40, 47, 64, 0.8);
  --line: rgba(170, 180, 202, 0.3);
  --text: #edf2ff;
  --muted: #b8c1d8;
  --neon: #a5b6de;
  --accent: #c9d3ea;
  --ok: #9fd7c8;
  --danger: #e88c97;
  --bg-radial-a: rgba(127, 139, 171, 0.34);
  --bg-radial-b: rgba(87, 97, 128, 0.35);
  --field-bg: rgba(26, 31, 45, 0.92);
  --field-placeholder: #a7b0c9;
}

body[data-theme="newyear"] {
  --bg-1: #072018;
  --bg-2: #6d0f1d;
  --panel: rgba(20, 45, 34, 0.82);
  --panel-2: rgba(64, 17, 33, 0.8);
  --line: rgba(255, 229, 157, 0.35);
  --text: #fff6e8;
  --muted: #ffe4bf;
  --neon: #ffe173;
  --accent: #ff5b7f;
  --ok: #57e4a5;
  --danger: #ff5a68;
  --bg-radial-a: rgba(75, 219, 168, 0.38);
  --bg-radial-b: rgba(255, 92, 131, 0.34);
}

body[data-theme="summer"] {
  --bg-1: #00304e;
  --bg-2: #067a87;
  --panel: rgba(2, 40, 58, 0.78);
  --panel-2: rgba(3, 70, 80, 0.72);
  --line: rgba(119, 228, 255, 0.32);
  --text: #e8fbff;
  --muted: #b3edf5;
  --neon: #38e5ff;
  --accent: #ffd24a;
  --ok: #58efb7;
  --danger: #ff6f6f;
  --bg-radial-a: rgba(49, 213, 255, 0.46);
  --bg-radial-b: rgba(255, 201, 64, 0.3);
}

body[data-theme="autumn"] {
  --bg-1: #2e1509;
  --bg-2: #7b3713;
  --panel: rgba(48, 24, 12, 0.8);
  --panel-2: rgba(96, 42, 17, 0.74);
  --line: rgba(255, 180, 109, 0.28);
  --text: #ffe9d0;
  --muted: #f8bf85;
  --neon: #ffb24c;
  --accent: #ff663f;
  --ok: #ffd56f;
  --danger: #ff4462;
  --bg-radial-a: rgba(243, 128, 51, 0.42);
  --bg-radial-b: rgba(188, 70, 39, 0.4);
}

body[data-theme="winter"] {
  --bg-1: #061126;
  --bg-2: #254774;
  --panel: rgba(9, 26, 52, 0.8);
  --panel-2: rgba(15, 49, 86, 0.74);
  --line: rgba(169, 212, 255, 0.3);
  --text: #e6f5ff;
  --muted: #b1d0ef;
  --neon: #8de9ff;
  --accent: #91acff;
  --ok: #95f3de;
  --danger: #ff6886;
  --bg-radial-a: rgba(131, 202, 255, 0.42);
  --bg-radial-b: rgba(190, 210, 255, 0.29);
}

body[data-theme="spring"] {
  --bg-1: #13263b;
  --bg-2: #2f6c4d;
  --panel: rgba(17, 44, 54, 0.79);
  --panel-2: rgba(43, 90, 72, 0.72);
  --line: rgba(136, 238, 191, 0.29);
  --text: #eaffef;
  --muted: #b9f1cf;
  --neon: #53e7c4;
  --accent: #8cd9ff;
  --ok: #8df7b3;
  --danger: #ff6d8a;
  --bg-radial-a: rgba(105, 232, 163, 0.42);
  --bg-radial-b: rgba(146, 220, 255, 0.35);
}

body[data-theme="japan"] {
  --bg-1: #2a0f2a;
  --bg-2: #6d2a63;
  --panel: rgba(62, 21, 57, 0.82);
  --panel-2: rgba(95, 34, 86, 0.74);
  --line: rgba(255, 183, 227, 0.32);
  --text: #ffeef9;
  --muted: #ffcae8;
  --neon: #ff7fc2;
  --accent: #ff9ce8;
  --ok: #8ef4cb;
  --danger: #ff5f9f;
  --bg-radial-a: rgba(255, 136, 209, 0.38);
  --bg-radial-b: rgba(255, 188, 219, 0.32);
}

body[data-theme="greenland"] {
  --bg-1: #0d2a44;
  --bg-2: #2f7cab;
  --panel: rgba(16, 62, 94, 0.8);
  --panel-2: rgba(34, 101, 147, 0.72);
  --line: rgba(171, 230, 255, 0.36);
  --text: #ecf9ff;
  --muted: #d1efff;
  --neon: #8be7ff;
  --accent: #b5dcff;
  --ok: #a2f7e8;
  --danger: #ff8cb2;
  --bg-radial-a: rgba(150, 225, 255, 0.4);
  --bg-radial-b: rgba(193, 237, 255, 0.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 12%, var(--bg-radial-a), transparent 40%),
    radial-gradient(circle at 85% 16%, var(--bg-radial-b), transparent 38%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(130, 170, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 170, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 55%, transparent 100%);
  animation: grid-drift 20s linear infinite;
}

body[data-theme="newyear"] .app-bg::before {
  content: "🎄 🎁 🦌 ✨ 🎄 🎅 ❄ 🎁 ✨ 🦌";
  position: absolute;
  inset: 8% -20% auto;
  font-size: clamp(18px, 2.1vw, 34px);
  letter-spacing: 2.2vw;
  white-space: nowrap;
  opacity: 0.3;
  animation: theme-float 22s linear infinite;
}

body[data-theme="newyear"] .app-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.95) 1px, transparent 1.6px);
  background-size: 22px 22px;
  opacity: 0.35;
  animation: snow-shift 18s linear infinite;
}

body[data-theme="japan"] .app-bg::before {
  content: "⛩ ✿ ⛩ ✿ ⛩ ✿";
  position: absolute;
  inset: 9% -20% auto;
  letter-spacing: 2.1vw;
  white-space: nowrap;
  opacity: 0.28;
  font-size: clamp(18px, 2vw, 32px);
  animation: theme-float 24s linear infinite;
}

body[data-theme="greenland"] .app-bg::before {
  content: "❄ ◆ ❄ ◆ ❄ ◆ ❄";
  position: absolute;
  inset: 8% -16% auto;
  letter-spacing: 2vw;
  white-space: nowrap;
  opacity: 0.24;
  font-size: clamp(18px, 2vw, 30px);
  animation: theme-float 21s linear infinite;
}

body[data-theme="moon"] .app-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 22%, rgba(189, 196, 214, 0.2) 0 36px, rgba(102, 114, 145, 0.28) 37px 52px, transparent 53px),
    radial-gradient(circle at 78% 18%, rgba(185, 194, 214, 0.18) 0 30px, rgba(97, 108, 139, 0.26) 31px 45px, transparent 46px),
    radial-gradient(circle at 33% 68%, rgba(178, 188, 210, 0.16) 0 42px, rgba(92, 103, 133, 0.25) 43px 60px, transparent 61px),
    radial-gradient(circle at 86% 76%, rgba(173, 184, 208, 0.16) 0 28px, rgba(88, 98, 127, 0.24) 29px 40px, transparent 41px),
    radial-gradient(circle at 56% 44%, rgba(168, 178, 201, 0.14) 0 24px, rgba(82, 92, 119, 0.22) 25px 36px, transparent 37px);
  opacity: 0.65;
}

body[data-theme="moon"] .app-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(236, 242, 255, 0.72) 1px, transparent 1.8px);
  background-size: 34px 34px;
  opacity: 0.22;
  animation: snow-shift 22s linear infinite;
}

.hidden { display: none !important; }

body[data-theme="light"] .kpi,
body[data-theme="light"] .panel,
body[data-theme="light"] .table-card,
body[data-theme="light"] .preview-card,
body[data-theme="light"] .kanban-col,
body[data-theme="light"] .sales-kpi,
body[data-theme="light"] .help-card,
body[data-theme="light"] .keyword-item,
body[data-theme="light"] .ads-rec-kv {
  background: rgba(246, 250, 255, 0.96);
  border-color: rgba(102, 132, 188, 0.36);
}

body[data-theme="light"] .kpi-head strong,
body[data-theme="light"] .trend-meta b,
body[data-theme="light"] .sales-kpi strong,
body[data-theme="light"] .admin-chip,
body[data-theme="light"] th,
body[data-theme="light"] td {
  color: #163769;
}

body[data-theme="light"] .hint,
body[data-theme="light"] .cell-meta-small,
body[data-theme="light"] .sales-kpi span {
  color: #355b8f;
}

body[data-theme="light"] .status-wrap {
  background: rgba(238, 246, 255, 0.95);
  border-color: rgba(122, 156, 216, 0.42);
}

body[data-theme="light"] .reviews-table th:last-child,
body[data-theme="light"] .reviews-table td:last-child,
body[data-theme="light"] .questions-table th:last-child,
body[data-theme="light"] .questions-table td:last-child {
  background: rgba(239, 247, 255, 0.98);
}

body[data-theme="light"] .review-type-pill {
  background: rgba(219, 236, 255, 0.96);
  color: #224a80;
}

.auth-wrap {
  min-height: 100vh;
  display: block;
  padding: 20px;
}
.landing-wrap {
  width: min(1320px, 100%);
  display: grid;
  gap: 14px;
  margin: 0 auto;
}
.auth-toolbar {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  background: linear-gradient(145deg, rgba(10, 22, 56, 0.8), rgba(14, 31, 74, 0.72));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.auth-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-toolbar-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.auth-toolbar-title {
  font-family: "Unbounded", sans-serif;
  font-size: 15px;
  color: #f0f6ff;
}
.auth-toolbar-subtitle {
  font-size: 12px;
  color: #a8bee9;
}
.auth-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-lang-select {
  min-width: 84px;
}
.auth-card {
  width: min(920px, 100%);
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}
.auth-hero {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
}
.auth-pitch {
  border: 1px solid rgba(127, 168, 255, 0.28);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(10, 24, 60, 0.75), rgba(11, 32, 85, 0.65));
}
.auth-card h1 {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-size: 44px;
}
.logo-mark {
  letter-spacing: 0.02em;
}
.logo-a {
  color: #eef5ff;
  text-shadow: 0 1px 8px rgba(8, 12, 24, 0.6);
}
.logo-b {
  background: linear-gradient(100deg, #1be0ff, #8b95ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-card p { margin: 10px 0 18px; color: var(--muted); }
.auth-card .lead {
  margin: 10px 0 14px;
  color: #d9e6ff;
  font-size: 20px;
  line-height: 1.35;
}
.pitch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pitch-grid article {
  border: 1px solid rgba(126, 166, 255, 0.2);
  border-radius: 14px;
  padding: 12px;
  background: rgba(8, 15, 36, 0.58);
}
.pitch-grid h4 {
  margin: 0 0 8px;
  font-family: "Unbounded", sans-serif;
  font-size: 15px;
}
.pitch-grid ul,
.pitch-grid ol {
  margin: 0;
  padding-left: 18px;
  color: #bfd2ff;
  line-height: 1.45;
}
.pitch-note {
  margin-top: 12px;
  color: #a7bde9;
  font-size: 14px;
}
.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.auth-main-box {
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
}
.auth-main-box #authLoginPane,
.auth-main-box #authRegisterPane {
  display: grid;
  gap: 10px;
}
.auth-main-box .btn-secondary {
  background: rgba(20, 35, 76, 0.82);
  color: #dcedff;
  border: 1px solid rgba(134, 172, 255, 0.36);
}
.auth-main-box .btn-secondary:hover {
  background: rgba(28, 49, 102, 0.88);
}
.auth-mode-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.auth-mode-switch .chip-btn {
  flex: 1 1 0;
}
.auth-box {
  border: 1px solid rgba(127, 168, 255, 0.25);
  border-radius: 16px;
  padding: 14px;
  background: rgba(7, 13, 32, 0.72);
}
.landing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}
.landing-card {
  border: 1px solid rgba(127, 168, 255, 0.22);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(145deg, rgba(8, 17, 41, 0.74), rgba(11, 26, 65, 0.68));
}
.landing-card h3 {
  margin: 0 0 8px;
  font-family: "Unbounded", sans-serif;
  font-size: 18px;
}
.landing-card p {
  margin: 0 0 10px;
  color: #bfd2ff;
  line-height: 1.45;
}
.landing-chart {
  height: 98px;
  border: 1px solid rgba(125, 160, 248, 0.24);
  border-radius: 12px;
  background: rgba(6, 14, 34, 0.7);
  display: flex;
  align-items: end;
  gap: 6px;
  padding: 10px;
}
.landing-chart i {
  flex: 1;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #13d5ff, #6f7eff);
  display: block;
}
.partners {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.partners span {
  border: 1px solid rgba(130, 169, 255, 0.3);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  color: #dce8ff;
  background: rgba(12, 23, 54, 0.62);
}
.review {
  border: 1px solid rgba(126, 166, 255, 0.24);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(8, 16, 36, 0.6);
}
.review strong {
  display: block;
  margin-bottom: 4px;
}
.review small {
  color: #acc3ef;
}
.faq-list {
  margin: 0;
  padding-left: 18px;
  color: #c4d5ff;
  line-height: 1.45;
}
.landing-band {
  border: 1px solid rgba(137, 175, 255, 0.28);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(120deg, rgba(17, 36, 88, 0.65), rgba(25, 44, 106, 0.56));
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}
.landing-band h3 {
  margin: 0 0 8px;
}
.landing-band p {
  margin: 0;
  color: #d1dfff;
}
.band-stats {
  display: grid;
  gap: 8px;
}
.band-stats span {
  border: 1px solid rgba(132, 170, 255, 0.26);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(9, 17, 40, 0.62);
}
.bar-list {
  display: grid;
  gap: 8px;
}
.bar-item {
  display: grid;
  gap: 4px;
}
.bar-item .line {
  height: 9px;
  border-radius: 999px;
  background: rgba(104, 136, 222, 0.26);
  overflow: hidden;
}
.bar-item .line i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #18d9ff, #7385ff);
}
.bar-item .meta {
  display: flex;
  justify-content: space-between;
  color: #bcd0ff;
  font-size: 13px;
}

.app-shell {
  position: relative;
  z-index: 2;
  max-width: min(1880px, calc(100vw - 12px));
  margin: 16px auto;
  padding: 0 16px 24px;
  display: grid;
  --sidebar-width: 250px;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.sidebar {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border-radius: 20px;
  padding: 16px;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  transition: width 0.2s ease, padding 0.2s ease;
}
.brand h2 {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-size: 26px;
}
.brand p { margin: 6px 0 0; color: var(--muted); }

.side-nav {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  overflow: hidden;
}
.nav-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(19, 31, 72, 0.9);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
}

.nav-icon {
  width: 18px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #98bcff;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.nav-icon img {
  width: 17px;
  height: 17px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.24));
}

.nav-label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-toggle {
  width: 100%;
}

.sidebar.compact {
  width: 82px;
  min-width: 82px;
  padding-left: 10px;
  padding-right: 10px;
}

.app-shell.sidebar-compact {
  --sidebar-width: 82px;
  grid-template-columns: 82px minmax(0, 1fr);
}

.sidebar.compact .brand p,
.sidebar.compact .nav-label,
.sidebar.compact .btn-danger.full {
  display: none;
}

.sidebar.compact .brand h2 {
  font-size: 19px;
  text-align: center;
}

.sidebar.compact .nav-btn {
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
}
.nav-btn:hover { border-color: var(--line); }
.nav-btn.active {
  background: linear-gradient(120deg, rgba(21, 209, 255, 0.3), rgba(109, 120, 255, 0.35));
  border-color: rgba(21, 209, 255, 0.55);
}

.workspace {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(140deg, rgba(10, 18, 46, 0.74), rgba(14, 29, 70, 0.68));
  padding: 14px;
  min-width: 0;
  min-height: calc(100vh - 32px);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(153, 180, 255, 0.2), 0 24px 70px rgba(0, 0, 0, 0.35);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(9, 16, 39, 0.68);
  margin-bottom: 14px;
}
.topbar-title {
  flex: 1 1 auto;
  min-width: 0;
}
.topbar-title h1,
.topbar-title p {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.topbar h1 { margin: 0; font-size: 28px; font-family: "Unbounded", sans-serif; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.mobile-chat-compact-head {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.mobile-chat-compact-back {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--panel-bg) 86%, #ffffff);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.mobile-chat-compact-text {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.mobile-chat-compact-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-chat-compact-title.is-clickable,
.mobile-chat-compact-subtitle.is-clickable {
  cursor: pointer;
}

.mobile-chat-compact-title.is-clickable:hover,
.mobile-chat-compact-subtitle.is-clickable:hover {
  color: color-mix(in oklab, var(--accent) 66%, var(--text));
}

.mobile-chat-compact-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-chat-compact-subtitle.online-now {
  color: color-mix(in oklab, #16c784 74%, var(--text));
  font-weight: 700;
}

.social-announcement-modal {
  display: grid;
  gap: 12px;
}

.social-announcement-body {
  white-space: pre-wrap;
  line-height: 1.45;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklab, var(--panel-bg) 90%, #ffffff);
  padding: 10px 12px;
}

.mobile-nav-toggle {
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 18px;
  display: none;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 12, 28, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1100;
}
.topbar-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.topbar-user-icon {
  font-size: 16px;
}
.topbar-user-meta {
  display: grid;
  gap: 2px;
  text-align: left;
}
.topbar-user-meta small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}
.topbar-user-wrap {
  position: relative;
}
.topbar-avatar-btn {
  height: 40px;
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.2px;
  overflow: hidden;
}
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--panel-bg) 55%, var(--accent));
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}
.topbar-avatar-name {
  font-size: 13px;
  font-weight: 700;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar-fallback {
  font-size: 12px;
}
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.topbar-avatar-btn .avatar-img {
  border-radius: 50%;
}
.topbar-avatar-btn .avatar-img.hidden + #topbarAvatarText {
  display: inline;
}
.topbar-avatar-btn .avatar-img:not(.hidden) + #topbarAvatarText {
  display: none;
}
.topbar-popover {
  position: absolute;
  right: 0;
  top: 52px;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 16, 39, 0.95);
  padding: 12px;
  display: grid;
  gap: 10px;
  z-index: 20;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.topbar-popover-head {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
}
.topbar-popover .avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(46, 197, 255, 0.2);
  display: grid;
  place-items: center;
  font-weight: 800;
  overflow: hidden;
}
.topbar-popover .avatar.has-avatar #topbarPopoverAvatarText {
  display: none;
}
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(21, 209, 255, 0.14);
  font-weight: 700;
}
.chip-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(21, 209, 255, 0.14);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.chip-btn:hover {
  transform: translateY(-1px);
}
.chip-btn.active {
  background: rgba(109, 120, 255, 0.28);
  border-color: rgba(21, 209, 255, 0.65);
}
.module-subtabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(21, 209, 255, 0.12);
  color: var(--text);
  font-weight: 700;
  padding: 8px 12px;
  width: auto;
  min-width: 100px;
}

.panel,
.table-card,
.preview-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(9, 17, 40, 0.72);
  padding: 12px;
  margin-bottom: 12px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.trend-chart {
  width: 100%;
  height: 180px;
  border: 1px solid rgba(158, 183, 255, 0.26);
  border-radius: 12px;
  background: rgba(7, 14, 34, 0.68);
}
.trend-chart.mini {
  height: 150px;
}
.trend-meta {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: #bad0ff;
  font-size: 13px;
}
.trend-meta b {
  color: #fff;
}

.kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  margin-bottom: 12px;
}
.kpi {
  border: 1px solid rgba(138, 167, 255, 0.35);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(17, 31, 76, 0.9), rgba(19, 37, 96, 0.75));
}
.kpi-head strong { display: block; font-size: 25px; color: #9cf1ff; }
.kpi-head span { color: #bfd2ff; font-size: 13px; }
.kpi-track {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(120, 150, 240, 0.24);
  overflow: hidden;
}
.kpi-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--neon), var(--accent));
}

.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-pass { width: 220px; }

#adminTab-users .actions {
  align-items: center;
}

#adminTab-users .actions .btn-danger,
#adminTab-users .actions .btn-secondary {
  padding: 10px 12px;
}

.grid-6, .grid-5, .grid-4, .grid-3, .grid-2, .grid-1 {
  display: grid;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.grid-6 { grid-template-columns: 150px 1.3fr auto auto auto auto; }
.grid-5 { grid-template-columns: 1.4fr 120px auto auto auto; }
.grid-4 { grid-template-columns: 1.3fr 1fr auto auto; }
.grid-3 { grid-template-columns: 170px 1fr auto; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-1 { grid-template-columns: 1fr; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

#products .grid-6 {
  grid-template-columns: 112px minmax(180px, 1fr) minmax(150px, auto) repeat(4, 48px);
}

#products .products-controls {
  grid-template-columns: 112px minmax(180px, 1fr) repeat(4, 48px);
  align-items: end;
}

#products .products-controls #productCategoryFilter:disabled {
  opacity: 0.65;
  filter: saturate(0.85);
  cursor: not-allowed;
}

#products .products-bulk-delete.is-soft-hidden {
  opacity: 0;
  pointer-events: none;
}

#products .grid-4 {
  grid-template-columns: minmax(210px, 1.35fr) minmax(180px, 1fr) 48px 48px;
}

#products .check {
  white-space: nowrap;
  font-size: 13px;
}

.reviews-controls,
.questions-controls {
  grid-template-columns: repeat(8, minmax(96px, 1fr));
  align-items: end;
}

#reviews .panel > .grid-6:first-of-type,
#reviewsSubtabQuestions .panel > .grid-6:first-of-type {
  grid-template-columns: repeat(8, minmax(96px, 1fr));
  align-items: end;
}

#reviewsSubtabQuestions .panel > .grid-6:first-of-type {
  grid-template-columns: repeat(7, minmax(96px, 1fr));
}

#reviews .panel > .grid-2,
#reviewsSubtabQuestions .panel > .grid-2 {
  grid-template-columns: minmax(220px, 1fr);
  max-width: 440px;
}

#reviews .panel > .grid-2 > div:empty,
#reviewsSubtabQuestions .panel > .grid-2 > div:empty {
  display: none;
}

.ads-toolbar-main {
  grid-template-columns: minmax(180px, 1.1fr) minmax(120px, 0.9fr) minmax(110px, 0.7fr) minmax(150px, 0.8fr);
}

.ads-toolbar-filters {
  grid-template-columns: minmax(170px, 1.25fr) repeat(3, minmax(118px, 0.9fr)) minmax(104px, 0.75fr) minmax(104px, 0.75fr);
}

.ads-toolbar-meta {
  grid-template-columns: minmax(180px, 0.85fr) minmax(150px, 0.8fr) minmax(220px, 1.35fr);
}

.ads-toolbar-main > *,
.ads-toolbar-filters > *,
.ads-toolbar-meta > * {
  min-width: 0;
}

.ads-bidder-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.ads-bidder-actions {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.ads-bidder-status-ok {
  color: #138b4f;
}

.ads-bidder-status-error {
  color: #d14747;
}

.ads-bidder-status-skipped {
  color: #7b8aa9;
}

.ads-bidder-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sales-quick-range {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.sales-chart-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.sales-chart-controls select {
  width: auto;
  min-width: 160px;
}

.sales-cost-field {
  display: inline-grid;
  grid-template-columns: 1fr;
  gap: 4px;
  align-items: center;
  min-width: 170px;
}

.sales-cost-field span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.sales-cost-field input {
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 10px;
}

.sales-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.sales-extra-wrap {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(133, 165, 255, 0.24);
}

.sales-kpis-extra {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.sales-kpis-extra .sales-kpi strong {
  font-size: clamp(15px, 1.25vw, 24px);
}

.sales-kpi {
  border: 1px solid rgba(133, 165, 255, 0.28);
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(140deg, rgba(10, 20, 50, 0.66), rgba(18, 35, 80, 0.62));
  min-width: 0;
}

.sales-kpi span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.sales-kpi strong {
  display: block;
  font-size: clamp(18px, 1.7vw, 34px);
  line-height: 1.06;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

h2, h3 { margin: 4px 0 10px; }
.hint { color: var(--muted); }
#wbAdsLoadStatus {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
}
#reviewLoadStatus,
#questionLoadStatus,
#adsRecLoadStatus,
#salesLoadStatus {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
}

.status-wrap {
  border: 1px solid rgba(130, 169, 255, 0.32);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(8, 16, 39, 0.56);
}

.status-wrap .status-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.status-wrap .status-head b {
  color: #d9eaff;
  font-weight: 700;
}

.status-wrap .status-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(101, 137, 220, 0.25);
  overflow: hidden;
}

.status-wrap .status-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #23e2b2, #28c7ff);
}

.status-wrap.done .status-track i {
  background: linear-gradient(90deg, #74ffcf, #8ea1ff);
}

input, select, textarea {
  width: 100%;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(153, 180, 255, 0.34);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
select option,
select optgroup {
  background-color: var(--field-bg);
  color: var(--text);
}
body[data-theme="classic"] select,
body[data-theme="dark"] select,
body[data-theme="winter"] select,
body[data-theme="newyear"] select,
body[data-theme="japan"] select {
  color-scheme: dark;
}
body[data-theme="light"] select,
body[data-theme="light"] option,
body[data-theme="light"] optgroup {
  background-color: #f5f8ff !important;
  color: #122744 !important;
  color-scheme: light;
}
input::placeholder { color: var(--field-placeholder); }
textarea::placeholder { color: var(--field-placeholder); }
textarea {
  resize: vertical;
  min-height: 112px;
  margin-bottom: 8px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 800;
  color: #031632;
  background: linear-gradient(120deg, var(--neon), #73e5ff);
  cursor: pointer;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(5, 20, 54, 0.22);
  font-size: 13px;
  font-weight: 900;
}

.btn-icon svg,
.icon-only-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-label {
  white-space: nowrap;
}

.btn-icon-only-auto {
  width: 44px;
  min-width: 44px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.icon-only-btn {
  width: 48px;
  min-width: 48px;
  height: 44px;
  padding: 0;
  font-size: 0;
  line-height: 1;
  display: grid;
  place-items: center;
  border-radius: 11px;
}
button:hover { filter: brightness(1.07); }
.btn-secondary {
  color: #032524;
  background: linear-gradient(120deg, var(--ok), #55f5c7);
}
.btn-danger {
  color: #fff;
  background: linear-gradient(120deg, #e12257, var(--danger));
}
.full { margin-top: auto; width: 100%; }

.check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}
.remember-row {
  margin: 6px 0 2px;
  font-size: 14px;
}
input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--neon);
}

.table-card { overflow: auto; }
.products-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0;
  flex-wrap: wrap;
}
.products-pager-left,
.products-pager-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.products-pager select {
  width: auto;
  min-width: 88px;
}
.products-pager .btn-secondary {
  padding: 8px 12px;
  min-height: 36px;
}
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px; border-bottom: 1px solid rgba(157, 183, 255, 0.14); vertical-align: top; }
th {
  color: #a8bde9;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}
.products-table,
.seo-table,
.ads-table,
.sales-table {
  min-width: 760px;
}
.products-table {
  table-layout: fixed;
}
.products-table th,
.products-table td {
  overflow-wrap: anywhere;
}
.products-table th:nth-child(1),
.products-table td:nth-child(1) {
  width: 54px;
}
.products-table th:nth-child(2),
.products-table td:nth-child(2) {
  width: 86px;
}
.products-table th:nth-child(3),
.products-table td:nth-child(3),
.products-table th:nth-child(4),
.products-table td:nth-child(4),
.products-table th:nth-child(9),
.products-table td:nth-child(9) {
  width: 72px;
}
.products-table th:nth-child(5),
.products-table td:nth-child(5) {
  width: 160px;
}
.products-table th:nth-child(6),
.products-table td:nth-child(6),
.products-table th:nth-child(7),
.products-table td:nth-child(7) {
  width: 150px;
}
.products-table th:nth-child(10),
.products-table td:nth-child(10) {
  width: 166px;
  text-align: right;
}
.seo-table {
  table-layout: fixed;
}
.seo-table th,
.seo-table td {
  overflow-wrap: anywhere;
}
.seo-table th:nth-child(1),
.seo-table td:nth-child(1) {
  width: 56px;
}
.seo-table th:nth-child(2),
.seo-table td:nth-child(2),
.seo-table th:nth-child(6),
.seo-table td:nth-child(6) {
  width: 70px;
}
.seo-table th:nth-child(7),
.seo-table td:nth-child(7) {
  width: 130px;
}
.ads-table {
  min-width: 1180px;
}
.ads-table th,
.ads-table td {
  white-space: nowrap;
}
.ads-table td:nth-child(2),
.ads-table td:nth-child(3),
.ads-table td:nth-child(4),
.ads-table td:nth-child(5) {
  white-space: normal;
  overflow-wrap: anywhere;
}
.sales-table {
  min-width: 980px;
}
tbody tr {
  transition: background-color 0.2s ease, transform 0.2s ease;
}
tbody tr:hover {
  background: rgba(73, 127, 255, 0.11);
}
.selected-row {
  background: rgba(33, 231, 255, 0.12);
}
.review-reply-input {
  width: 100%;
  min-width: 0;
  min-height: 104px;
  padding: 10px;
  font-size: 13px;
  resize: vertical;
}
.review-actions {
  display: flex;
  gap: 6px;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}
.review-actions button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.feedback-card-cell {
  padding: 6px 0 !important;
  border-bottom: 0;
}
.feedback-row-card {
  border: 1px solid rgba(133, 165, 255, 0.28);
  border-radius: 14px;
  background: rgba(10, 20, 50, 0.52);
  padding: 10px 12px;
  display: grid;
  gap: 9px;
}
.feedback-row-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.feedback-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.feedback-meta-badge {
  border: 1px solid rgba(133, 165, 255, 0.36);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  color: var(--text);
  background: rgba(9, 21, 55, 0.58);
}
.feedback-product-line {
  border: 1px solid rgba(133, 165, 255, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(7, 16, 40, 0.46);
}
.feedback-text-line,
.feedback-reply-line {
  display: grid;
  gap: 6px;
}
.feedback-actions-row {
  margin-top: 2px;
}
.reviews-table {
  min-width: 0;
  width: 100%;
  table-layout: auto;
}
.reviews-table th:nth-child(1),
.reviews-table td:nth-child(1),
.questions-table th:nth-child(1),
.questions-table td:nth-child(1) {
  width: 64px;
}
.reviews-table th:nth-child(2),
.reviews-table td:nth-child(2),
.questions-table th:nth-child(2),
.questions-table td:nth-child(2) {
  width: 104px;
}
.reviews-table th:nth-child(3),
.reviews-table td:nth-child(3),
.questions-table th:nth-child(3),
.questions-table td:nth-child(3) {
  width: 280px;
}
.reviews-table th:nth-child(4),
.reviews-table td:nth-child(4) {
  width: 64px;
  text-align: center;
}
.reviews-table td:nth-child(5),
.questions-table td:nth-child(4) {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}
.reviews-table th:nth-child(6),
.reviews-table td:nth-child(6),
.questions-table th:nth-child(5),
.questions-table td:nth-child(5) {
  width: auto;
}

.reviews-table td:nth-child(6),
.questions-table td:nth-child(5) {
  min-width: 0;
  padding-right: 16px;
  vertical-align: top;
}
.questions-table {
  min-width: 0;
  width: 100%;
  table-layout: auto;
}
.questions-table th:nth-child(4),
.questions-table td:nth-child(4) {
  width: 320px;
}
.questions-table th:nth-child(5),
.questions-table td:nth-child(5) {
  width: 460px;
}
.questions-table .review-reply-input {
  width: 100%;
  min-width: 230px;
  min-height: 124px;
}
.questions-table .review-actions button {
  width: 32px;
}

.feedback-cards-table {
  min-width: 0;
}

.feedback-cards-table thead th {
  display: none;
}

.feedback-cards-table tbody tr {
  background: transparent;
}

.feedback-cards-table tbody tr:hover {
  background: transparent;
}

.feedback-cards-table th,
.feedback-cards-table td {
  width: auto !important;
  min-width: 0 !important;
  padding: 0 !important;
  border-bottom: 0 !important;
}

.feedback-cards-table td:last-child {
  width: auto !important;
  min-width: 0 !important;
}

.feedback-cards-table td.feedback-card-cell {
  padding: 6px 0 !important;
}

.reviews-table th,
.reviews-table td,
.questions-table th,
.questions-table td {
  width: auto !important;
  min-width: 0 !important;
  white-space: normal;
  overflow-wrap: anywhere;
}
.reviews-table th:last-child,
.reviews-table td:last-child,
.questions-table th:last-child,
.questions-table td:last-child {
  position: static;
  width: 82px;
  min-width: 82px;
  background: transparent;
  z-index: 1;
}
.reviews-table th:last-child,
.questions-table th:last-child {
  z-index: 1;
}
.review-photo-list {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.review-photo-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(153, 180, 255, 0.4);
  cursor: pointer;
}
.review-type-pill {
  border: 1px solid rgba(133, 165, 255, 0.35);
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 12px;
  color: #d8e7ff;
  background: rgba(9, 21, 55, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
}
.cell-main-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.35;
  font-size: 13px;
  max-height: 220px;
  overflow-y: auto;
}

.cell-product-text {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.35;
  font-size: 13px;
}

.cell-product-name {
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.cell-meta-small {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.icon-action-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-radius: 9px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.product-photo {
  max-width: 84px;
  max-height: 84px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(177, 201, 255, 0.45);
  background: transparent;
  padding: 0;
  display: block;
}
.product-photo.ph {
  display: inline-block;
  background:
    radial-gradient(circle at 28% 26%, rgba(21, 209, 255, 0.62), transparent 45%),
    linear-gradient(130deg, rgba(109, 120, 255, 0.5), rgba(16, 28, 60, 0.85));
}

.seo-split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  gap: 12px;
}
.products-catalog-wrap .table-card,
.seo-split .table-card {
  min-width: 0;
  max-height: 520px;
  overflow: auto;
}
#seoKanban {
  display: none;
}
.products-catalog-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.product-preview-card {
  display: grid;
  gap: 10px;
}
.product-trend-panel {
  padding: 10px;
}
.product-details-panel {
  display: grid;
  gap: 8px;
}
.product-details-panel h4 {
  margin: 0;
}
.product-details-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}
.product-detail-photo {
  width: 100%;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(133, 165, 255, 0.36);
}

.clickable-photo {
  cursor: zoom-in;
}
.preview-card.sticky {
  position: sticky;
  top: 84px;
  height: fit-content;
}
.preview-photo-wrap {
  width: 100%;
  border: 1px solid rgba(177, 201, 255, 0.45);
  border-radius: 12px;
  margin-bottom: 10px;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 220px;
}
.preview-photo {
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.preview-photo.ph {
  width: 100%;
  height: 280px;
  border: 1px solid rgba(177, 201, 255, 0.45);
}
.preview-photo.ph {
  background:
    radial-gradient(circle at 28% 26%, rgba(21, 209, 255, 0.62), transparent 45%),
    linear-gradient(130deg, rgba(109, 120, 255, 0.5), rgba(16, 28, 60, 0.85));
}
.product-preview-card h4 {
  margin: 8px 0 10px;
}
.preview-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 10px;
  font-size: 14px;
}
.preview-grid span {
  color: #9fb6e8;
}

.product-actions-cell {
  vertical-align: middle;
}

.product-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.products-table tbody tr:hover .product-row-actions,
.products-table tbody tr:focus-within .product-row-actions,
.products-table tbody tr.selected-row .product-row-actions {
  opacity: 1;
  pointer-events: auto;
}

.btn-row-action {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.btn-row-action-icon {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 15px;
}

.kanban {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}
.kanban-col {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: rgba(9, 17, 40, 0.74);
}
.kanban-col header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.kanban-col header span {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.08);
}
.kanban-items {
  display: grid;
  gap: 6px;
}
.kanban-item {
  border: 1px solid rgba(157, 183, 255, 0.2);
  border-radius: 10px;
  padding: 8px;
  background: rgba(15, 28, 62, 0.78);
}
.kanban-item div {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.kanban-item small {
  color: #b8caef;
  overflow-wrap: anywhere;
  display: block;
}
.kanban-empty {
  color: #8ea3d8;
  font-size: 13px;
}
.kanban-col.generated header strong { color: #7ddfff; }
.kanban-col.in-progress header strong { color: #7dbdff; }
.kanban-col.applied header strong { color: #8ef6cc; }
.kanban-col.top header strong { color: #f7dc8c; }
.preview-card {
  position: sticky;
  top: 84px;
  height: fit-content;
}
pre {
  white-space: pre-wrap;
  margin: 0;
  border: 1px solid rgba(158, 183, 255, 0.26);
  border-radius: 12px;
  padding: 12px;
  background: rgba(8, 15, 36, 0.84);
  color: #d8e5ff;
  line-height: 1.45;
}
.competitor-block {
  margin-top: 10px;
  border: 1px solid rgba(157, 183, 255, 0.18);
  border-radius: 12px;
  padding: 10px;
  background: rgba(8, 15, 36, 0.55);
}
.competitor-block h4 {
  margin: 0 0 8px;
}
.competitor-links {
  display: grid;
  gap: 6px;
}
.competitor-link {
  display: block;
  border: 1px solid rgba(157, 183, 255, 0.2);
  border-radius: 10px;
  padding: 8px;
  text-decoration: none;
  color: #cfe0ff;
  background: rgba(14, 28, 62, 0.62);
}
.competitor-link strong {
  color: #f2f6ff;
}
.competitor-link:hover {
  border-color: rgba(21, 209, 255, 0.55);
}
.auth-grid.single {
  grid-template-columns: 1fr;
  max-width: 560px;
  margin: 0 auto;
}
.brand-logo {
  width: 26px;
  height: 26px;
  margin-right: 7px;
  vertical-align: middle;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.admin-link {
  margin-top: 10px;
  display: inline-block;
  color: #7ddfff;
  text-decoration: none;
}
.admin-link:hover {
  text-decoration: underline;
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  background: rgba(6, 10, 24, 0.58);
  backdrop-filter: blur(4px);
}
.busy-card {
  width: min(420px, calc(100vw - 32px));
  border-radius: 16px;
  border: 1px solid rgba(137, 175, 255, 0.45);
  background: linear-gradient(145deg, rgba(12, 24, 57, 0.95), rgba(14, 30, 75, 0.92));
  padding: 16px;
  box-shadow: 0 24px 65px rgba(0, 0, 0, 0.4);
}
.busy-title {
  font-weight: 800;
  margin-bottom: 10px;
}
.busy-progress {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(90, 126, 211, 0.28);
  margin-bottom: 10px;
}
.busy-progress i {
  display: block;
  width: 38%;
  height: 100%;
  background: linear-gradient(90deg, #18d7ff, #7d88ff);
  border-radius: 999px;
  animation: busy-slide 1.2s ease-in-out infinite;
}
.busy-hint {
  margin: 0;
  color: #a8bfeb;
  font-size: 13px;
}

.photo-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 21, 0.82);
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-modal.hidden { display: none; }
.photo-modal img {
  max-width: min(92vw, 1200px);
  max-height: min(86vh, 880px);
  border-radius: 12px;
  border: 1px solid rgba(153, 180, 255, 0.45);
  background: rgba(8, 20, 48, 0.9);
}
.photo-nav, .photo-close {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(153, 180, 255, 0.45);
  background: rgba(4, 12, 32, 0.86);
  color: #dff2ff;
  font-size: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.photo-nav.prev { left: 28px; }
.photo-nav.next { right: 28px; }
.photo-close {
  top: 20px;
  right: 20px;
  font-size: 20px;
}
.photo-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(153, 180, 255, 0.45);
  background: rgba(4, 12, 32, 0.86);
  color: #dff2ff;
  font-size: 13px;
}

.campaign-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 21, 0.82);
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 14px;
}
.campaign-modal.hidden { display: none; }
.campaign-modal-card {
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid rgba(153, 180, 255, 0.42);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(8, 16, 39, 0.96), rgba(11, 27, 68, 0.92));
  color: var(--text);
  padding: 12px;
}
.campaign-modal table {
  min-width: 520px;
}
.campaign-modal .table-card,
.campaign-modal pre {
  color: inherit;
}
.campaign-modal th {
  color: var(--muted);
}
.campaign-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.campaign-modal-head h3 {
  margin: 0 0 8px;
}
.campaign-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(153, 180, 255, 0.45);
  background: rgba(4, 12, 32, 0.86);
  color: #dff2ff;
  font-size: 20px;
  display: grid;
  place-items: center;
}

.product-modal-card {
  width: min(1240px, 96vw);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.product-modal-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.product-modal-info {
  display: grid;
  gap: 4px;
}

.product-modal-section {
  border: 1px solid rgba(133, 165, 255, 0.26);
  border-radius: 14px;
  padding: 12px;
  background: rgba(8, 18, 44, 0.52);
  display: grid;
  gap: 10px;
}

.product-modal-section h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.product-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.product-kv-card {
  border: 1px solid rgba(133, 165, 255, 0.3);
  border-radius: 11px;
  padding: 8px 10px;
  background: rgba(9, 20, 50, 0.68);
  min-height: 62px;
  display: grid;
  align-content: start;
  gap: 3px;
}

.product-kv-card span {
  font-size: 11px;
  color: var(--muted);
}

.product-kv-card b {
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.product-modal-description {
  border: 1px solid rgba(133, 165, 255, 0.26);
  border-radius: 10px;
  background: rgba(7, 16, 42, 0.56);
  padding: 10px 11px;
  min-height: 70px;
  white-space: pre-wrap;
  line-height: 1.45;
}

.product-modal-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.product-photo-order-hint {
  margin-top: -2px;
}

.product-edit-photo-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 8px 0 6px;
}

.product-edit-photo-controls input {
  width: 100%;
}

.product-edit-photo-item {
  position: relative;
  border: 1px solid rgba(133, 165, 255, 0.34);
  border-radius: 12px;
  overflow: hidden;
  cursor: grab;
  background: rgba(7, 16, 42, 0.56);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.product-edit-photo-item:active {
  cursor: grabbing;
}

.product-edit-photo-item:hover {
  border-color: rgba(84, 191, 255, 0.72);
}

.product-edit-photo-item.drag-source {
  opacity: 0.55;
}

.product-edit-photo-item.drag-target {
  border-color: rgba(52, 214, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(52, 214, 255, 0.25) inset;
  transform: translateY(-1px);
}

.product-edit-photo-item.is-main {
  border-color: rgba(29, 206, 149, 0.92);
  box-shadow: 0 0 0 2px rgba(29, 206, 149, 0.24) inset;
}

.product-edit-photo-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

.product-edit-photo-index {
  position: absolute;
  top: 5px;
  left: 5px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(146, 180, 255, 0.42);
  background: rgba(7, 16, 42, 0.84);
  color: #e7f2ff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.product-edit-photo-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 154, 177, 0.65);
  background: rgba(32, 8, 18, 0.84);
  color: #ffd7df;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.product-edit-photo-remove:hover {
  border-color: rgba(255, 112, 151, 0.92);
  color: #fff1f5;
}

.product-edit-photo-main {
  position: absolute;
  right: 5px;
  bottom: 5px;
  border-radius: 999px;
  border: 1px solid rgba(146, 180, 255, 0.42);
  background: rgba(7, 16, 42, 0.84);
  color: #d5f9eb;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  white-space: nowrap;
}

.product-modal-attrs {
  display: grid;
  gap: 7px;
  margin: 8px 0 12px;
}

.product-attrs-table-wrap {
  overflow: auto;
}

.product-attrs-table {
  min-width: 560px;
}

.product-attrs-table td:first-child {
  width: 34%;
  color: var(--muted);
}

.product-modal-raw pre {
  max-height: 260px;
  overflow: auto;
}

.product-modal-trend {
  margin: 2px 0;
}

.product-edit-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr);
}

.product-edit-summary-col {
  align-content: start;
}

.product-edit-form-col {
  align-content: start;
}

.product-edit-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 10px;
}

.product-edit-form-grid label {
  display: grid;
  gap: 5px;
}

.product-edit-form-grid label > span {
  font-size: 12px;
  color: var(--muted);
}

.product-edit-form-grid label.full {
  grid-column: 1 / -1;
}

@media (max-width: 1080px) {
  .product-edit-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .product-edit-form-grid {
    grid-template-columns: 1fr;
  }
}

.hover-tip {
  position: fixed;
  z-index: 1300;
  max-width: min(360px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(158, 188, 255, 0.48);
  background: rgba(7, 15, 40, 0.82);
  color: #e4eeff;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
  backdrop-filter: blur(2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

#wbAdsMeta {
  overflow-wrap: anywhere;
  white-space: normal;
}

.keywords-grid {
  display: grid;
  gap: 8px;
}

.keyword-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(133, 165, 255, 0.26);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(10, 20, 50, 0.45);
}

.keyword-item > div {
  display: grid;
  gap: 2px;
}

.keyword-item span {
  font-size: 12px;
  color: var(--muted);
}

.ads-rec-meta {
  display: grid;
  gap: 8px;
}

.ads-rec-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}

.ads-rec-insight-card {
  border: 1px solid rgba(133, 165, 255, 0.3);
  border-radius: 12px;
  padding: 10px;
  background: rgba(8, 18, 44, 0.5);
  display: grid;
  gap: 7px;
}

.ads-rec-insight-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.ads-rec-insight-card header strong {
  font-size: 13px;
  line-height: 1.35;
}

.ads-rec-insight-card header span {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(133, 165, 255, 0.38);
  background: rgba(12, 29, 67, 0.6);
}

.ads-rec-insight-card.high header span {
  border-color: rgba(255, 113, 145, 0.52);
  background: rgba(110, 24, 47, 0.56);
}

.ads-rec-insight-card.medium header span {
  border-color: rgba(255, 209, 112, 0.54);
  background: rgba(96, 70, 24, 0.58);
}

.ads-rec-insight-card.low header span {
  border-color: rgba(130, 208, 255, 0.5);
  background: rgba(19, 55, 94, 0.55);
}

.ads-rec-insight-title {
  font-weight: 800;
}

.ads-rec-insight-reason {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.ads-rec-insight-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.ads-rec-insight-metrics span {
  border: 1px solid rgba(133, 165, 255, 0.22);
  border-radius: 999px;
  padding: 3px 8px;
}

.ads-rec-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.ads-rec-kv {
  border: 1px solid rgba(133, 165, 255, 0.3);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(8, 18, 44, 0.48);
}

.ads-rec-kv span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.ads-rec-kv strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.team-form-grid {
  align-items: end;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.team-form-grid button {
  grid-column: 1 / -1;
  max-width: 280px;
}
.team-form-stack {
  max-width: 620px;
  gap: 8px;
}
.team-create-form button {
  max-width: 320px;
}
.team-member-list {
  display: grid;
  gap: 10px;
}
.team-member-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(133, 165, 255, 0.24);
  border-radius: 12px;
  background: rgba(10, 23, 58, 0.5);
}
.team-member-toolbar .hint {
  margin: 0;
}
.team-member-toolbar #teamAddMemberBtn {
  min-width: 220px;
}
.team-member-row {
  border: 1px solid rgba(133, 165, 255, 0.28);
  border-radius: 14px;
  padding: 12px;
  background: rgba(9, 19, 48, 0.58);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.team-member-row-main {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1.1fr) minmax(120px, 0.6fr) minmax(220px, 1.3fr);
  align-items: center;
}
.team-member-identity strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}
.team-member-identity .hint {
  margin-top: 2px;
}
.team-member-role {
  justify-self: start;
  border: 1px solid rgba(133, 165, 255, 0.38);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(16, 30, 67, 0.64);
}
.team-member-access {
  min-width: 0;
}
.team-member-access strong {
  display: block;
  font-size: 13px;
}
.team-member-access .hint {
  margin-top: 3px;
}
.team-row-edit {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(133, 165, 255, 0.5);
  background: rgba(9, 20, 52, 0.88);
  color: var(--text);
  font-size: 18px;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}
.team-member-row:hover .team-row-edit,
.team-member-row:focus-within .team-row-edit {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.team-row-edit:hover {
  border-color: rgba(121, 230, 255, 0.72);
}

.team-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  background: rgba(3, 8, 21, 0.82);
  display: grid;
  place-items: center;
  padding: 14px;
}

.team-modal.hidden {
  display: none;
}

.team-modal-card {
  width: min(920px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid rgba(153, 180, 255, 0.42);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(8, 16, 39, 0.96), rgba(11, 27, 68, 0.92));
  color: var(--text);
  padding: 12px;
}

.team-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.team-modal-head h3 {
  margin: 0 0 6px;
}

.team-modal-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 10px 0 6px;
}

.team-modal-grid label,
.team-modal-access {
  display: grid;
  gap: 5px;
}

.team-modal-grid label > span,
.team-modal-access > span {
  font-size: 12px;
  color: var(--muted);
}

.team-modal-access {
  margin: 8px 0 12px;
}

.team-access-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 8px 0 12px;
}

.team-access-picks .check {
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid rgba(133, 165, 255, 0.25);
  background: rgba(10, 20, 50, 0.38);
}

.admin-team-access-wrap {
  grid-column: 1 / -1;
}

.admin-team-access-wrap .team-access-picks {
  margin: 4px 0 0;
}

.admin-team-table .team-access-picks,
.admin-team-list .team-access-picks {
  margin: 0;
  min-width: 220px;
}

@media (max-width: 980px) {
  .team-member-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .team-member-toolbar #teamAddMemberBtn {
    width: 100%;
    min-width: 0;
  }
  .team-member-row-main {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .team-row-edit {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

#profileAiServicesTable .actions,
#adminAiGlobalTable .actions,
#adminAiUserTable .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 8px 0 10px;
}

.help-rich {
  font-family: "IBM Plex Sans", "Manrope", sans-serif;
  display: grid;
  gap: 12px;
}

.help-empty {
  border: 1px dashed rgba(129, 166, 255, 0.35);
  border-radius: 12px;
  padding: 14px;
  color: var(--muted);
}

.help-header {
  border: 1px solid rgba(129, 166, 255, 0.3);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(140deg, rgba(10, 20, 50, 0.66), rgba(18, 35, 80, 0.62));
}

.help-header-title h4 {
  margin: 0 0 6px;
  font-family: "Unbounded", sans-serif;
  font-size: 18px;
}

.help-header-title p {
  margin: 0 0 10px;
  color: var(--muted);
}

.help-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.help-chip-btn,
.help-filter-btn {
  border-radius: 999px;
  border: 1px solid rgba(133, 165, 255, 0.35);
  background: rgba(10, 22, 54, 0.78);
  color: var(--text);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.help-filter-btn {
  border-radius: 10px;
  padding: 6px 10px;
}
.help-chip-btn.active {
  border-color: rgba(115, 228, 255, 0.78);
  background: rgba(17, 49, 95, 0.94);
}

.help-card-list {
  display: grid;
  gap: 12px;
}

.help-card {
  border: 1px solid rgba(133, 165, 255, 0.3);
  border-radius: 14px;
  padding: 12px;
  background: rgba(8, 16, 39, 0.58);
}
.help-card.selected {
  border-color: rgba(121, 230, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(121, 230, 255, 0.25);
}

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

.help-card-head h4 {
  margin: 0;
  font-size: 18px;
}

.help-card-head small {
  color: var(--muted);
}

.help-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.help-open-btn {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.help-block h5 {
  margin: 0 0 6px;
  font-size: 14px;
}

.help-block p,
.help-block ul,
.help-block ol {
  margin: 0 0 8px;
  line-height: 1.45;
}

.help-block ul,
.help-block ol {
  padding-left: 20px;
}

.help-callout {
  border-left: 4px solid rgba(120, 185, 255, 0.75);
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
  background: rgba(16, 32, 72, 0.58);
}

.help-callout.main {
  border-left-color: #3de3a5;
}

.help-callout.example {
  border-left-color: #ffd06f;
}

.help-callout.warn {
  border-left-color: #ff6d8a;
}

.help-checklist {
  border-top: 1px solid rgba(133, 165, 255, 0.22);
  padding-top: 9px;
  margin-top: 8px;
}

.help-checklist strong {
  display: block;
  margin-bottom: 6px;
  color: #d7e8ff;
}

.help-checklist ol {
  margin: 0;
  padding-left: 20px;
  line-height: 1.45;
}

.admin-user-details {
  padding: 8px 0;
}

.admin-user-profile-card {
  border: 1px solid rgba(133, 165, 255, 0.3);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(11, 22, 54, 0.76), rgba(16, 34, 80, 0.64));
  padding: 12px;
  display: grid;
  gap: 10px;
}

.admin-user-profile-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-user-avatar {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(133, 165, 255, 0.35);
  background: rgba(9, 20, 50, 0.8);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  overflow: hidden;
}

.admin-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(133, 165, 255, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: rgba(16, 34, 80, 0.58);
}

.admin-user-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
}

.admin-user-field {
  display: grid;
  gap: 4px;
}

.admin-user-field span {
  font-size: 12px;
  color: var(--muted);
}

.admin-user-field input,
.admin-user-field textarea {
  padding: 9px 10px;
  border-radius: 10px;
}

.admin-user-field-wide {
  grid-column: 1 / -1;
}

.admin-user-plan-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-user-plan-bar select {
  max-width: 220px;
}

.admin-user-credentials {
  border-top: 1px solid rgba(133, 165, 255, 0.2);
  padding-top: 8px;
}

.admin-team-box {
  border-top: 1px solid rgba(133, 165, 255, 0.2);
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.admin-team-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-team-create {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.admin-team-list {
  display: grid;
  gap: 10px;
}

.admin-team-card {
  border: 1px solid rgba(133, 165, 255, 0.3);
  border-radius: 14px;
  padding: 10px;
  background: rgba(9, 19, 48, 0.5);
  display: grid;
  gap: 10px;
}

.admin-team-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-team-card-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-team-card-grid label {
  display: grid;
  gap: 4px;
}

.admin-team-card-grid label > span {
  font-size: 12px;
  color: var(--muted);
}

.admin-team-card .actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-team-card .team-access-picks {
  margin-top: 0;
}

#adminPanelSection .panel,
#adminPanelSection .table-card,
#adminPanelSection .admin-user-profile-card,
#adminPanelSection .admin-team-card,
#adminPanelSection .admin-ai-item,
#adminPanelSection .admin-audit-details {
  color: var(--text);
}

#adminPanelSection .table-card table,
#adminPanelSection .table-card th,
#adminPanelSection .table-card td,
#adminPanelSection .table-card tr {
  color: var(--text);
  opacity: 1;
}

#adminPanelSection .panel h1,
#adminPanelSection .panel h2,
#adminPanelSection .panel h3,
#adminPanelSection .panel h4,
#adminPanelSection .table-card h1,
#adminPanelSection .table-card h2,
#adminPanelSection .table-card h3,
#adminPanelSection .table-card h4,
#adminPanelSection .table-card th,
#adminPanelSection .table-card td,
#adminPanelSection .admin-team-card-grid label,
#adminPanelSection .admin-user-field,
#adminPanelSection .admin-user-profile-head,
#adminPanelSection .admin-ai-item .ai-title {
  color: var(--text);
}

#adminPanelSection .hint,
#adminPanelSection .admin-user-field span,
#adminPanelSection .admin-team-card-grid label > span {
  color: color-mix(in oklab, var(--text) 85%, var(--text-muted));
}

#adminPanelSection .admin-audit-details .row b {
  color: var(--text);
}

#adminPanelSection {
  --admin-strong-text: color-mix(in oklab, var(--text) 88%, #ffffff);
}

#adminPanelSection .table-card,
#adminPanelSection .table-card th,
#adminPanelSection .table-card td,
#adminPanelSection .table-card tr,
#adminPanelSection .admin-user-profile-card,
#adminPanelSection .admin-team-card,
#adminPanelSection .admin-ai-item,
#adminPanelSection .admin-audit-details {
  color: var(--admin-strong-text);
}

#adminPanelSection .hint,
#adminPanelSection .admin-user-field span,
#adminPanelSection .admin-team-card-grid label > span {
  color: color-mix(in oklab, var(--admin-strong-text) 70%, var(--text-muted));
}

.admin-ai-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.admin-ai-priority {
  display: grid;
  gap: 8px;
}

.admin-ai-item {
  border: 1px solid rgba(133, 165, 255, 0.28);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(9, 19, 48, 0.55);
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
}

.admin-ai-item.readonly {
  opacity: 0.8;
  cursor: default;
}

.admin-ai-item.dragging {
  opacity: 0.6;
}

.admin-ai-item .drag-handle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px dashed rgba(133, 165, 255, 0.4);
  display: grid;
  place-items: center;
  color: rgba(190, 215, 255, 0.85);
  font-size: 14px;
}

.admin-ai-item .ai-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-ai-item .ai-meta {
  font-size: 12px;
  color: var(--muted);
}

.admin-server-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.admin-server-charts .panel {
  padding: 10px;
}

.admin-server-charts .trend-chart {
  height: 160px;
}

.admin-audit-kv {
  display: grid;
  gap: 3px;
  font-size: 12px;
  line-height: 1.35;
}

.admin-audit-kv b {
  color: #a9cdfd;
}

.admin-audit-details {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px dashed rgba(133, 165, 255, 0.35);
  border-radius: 12px;
  background: rgba(9, 19, 48, 0.45);
  font-size: 12px;
}

.admin-audit-details .row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
}

.admin-audit-details .row b {
  color: #a9cdfd;
}

#adminTab-audit table {
  min-width: 1380px;
}

#adminTab-audit .table-card {
  max-height: 68vh;
}

#adminTab-audit td:nth-child(3) {
  min-width: 210px;
}

#adminTab-audit td:nth-child(8) {
  min-width: 340px;
}

.admin-audit-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
}

.admin-audit-pager .hint {
  margin-left: auto;
  margin-right: auto;
}

.admin-debug {
  margin-top: 10px;
}

.admin-debug > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.admin-debug[open] > summary {
  margin-bottom: 8px;
}

body[data-theme="light"] .sidebar,
body[data-theme="light"] .workspace,
body[data-theme="light"] .topbar,
body[data-theme="light"] .panel,
body[data-theme="light"] .table-card,
body[data-theme="light"] .preview-card,
body[data-theme="light"] pre {
  background: rgba(255, 255, 255, 0.95);
  color: #102848;
}

body[data-theme="light"] .sidebar {
  box-shadow: 0 12px 40px rgba(42, 73, 131, 0.15);
}

body[data-theme="light"] .nav-btn {
  background: rgba(241, 247, 255, 0.95);
  border-color: rgba(111, 140, 201, 0.24);
  color: #173863;
}

body[data-theme="light"] .nav-btn.active {
  background: linear-gradient(120deg, rgba(63, 158, 217, 0.22), rgba(94, 114, 212, 0.24));
  border-color: rgba(63, 158, 217, 0.45);
}

body[data-theme="light"] .nav-icon {
  background: rgba(214, 229, 252, 0.9);
  color: #214a79;
}

body[data-theme="light"] .topbar h1,
body[data-theme="light"] h2,
body[data-theme="light"] h3,
body[data-theme="light"] td {
  color: #14365f;
}

body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea {
  color: #163a66;
  border-color: rgba(102, 136, 194, 0.4);
  background: rgba(255, 255, 255, 0.98);
}
body[data-theme="light"] select option,
body[data-theme="light"] select optgroup {
  background-color: #ffffff;
  color: #15375f;
}

body[data-theme="moon"] select option,
body[data-theme="moon"] select optgroup {
  background-color: #222838;
  color: #edf2ff;
}

body[data-theme="light"] button {
  color: #0f2f56;
}

body[data-theme="light"] .btn-danger {
  color: #fff;
}

body[data-theme="light"] th {
  color: #315384;
}

body[data-theme="light"] .trend-meta,
body[data-theme="light"] .kpi-head span,
body[data-theme="light"] .review-type-pill {
  color: #254b79;
  font-weight: 700;
}

body[data-theme="light"] .trend-meta b,
body[data-theme="light"] .kpi-head strong,
body[data-theme="light"] .competitor-link strong {
  color: #102848;
}

body[data-theme="light"] .review-type-pill {
  background: rgba(222, 235, 255, 0.9);
  border-color: rgba(98, 134, 193, 0.4);
}

body[data-theme="light"] .reviews-table th:last-child,
body[data-theme="light"] .reviews-table td:last-child,
body[data-theme="light"] .questions-table th:last-child,
body[data-theme="light"] .questions-table td:last-child {
  background: rgba(245, 250, 255, 0.96);
}

body[data-theme="light"] .auth-card,
body[data-theme="light"] .auth-pitch,
body[data-theme="light"] .auth-box,
body[data-theme="light"] .landing-card,
body[data-theme="light"] .landing-band,
body[data-theme="light"] .band-stats span,
body[data-theme="light"] .review {
  background: rgba(255, 255, 255, 0.94);
  color: #102848;
}

body[data-theme="light"] .auth-card .lead,
body[data-theme="light"] .landing-card p,
body[data-theme="light"] .pitch-note,
body[data-theme="light"] .pitch-grid ul,
body[data-theme="light"] .pitch-grid ol,
body[data-theme="light"] .faq-list,
body[data-theme="light"] .review small,
body[data-theme="light"] .hint,
body[data-theme="light"] .cell-meta-small {
  color: #2f537b;
}

body[data-theme="light"] .sales-kpi strong,
body[data-theme="light"] .status-wrap .status-head b {
  color: #17365f;
}

body[data-theme="light"] .status-wrap {
  background: rgba(241, 247, 255, 0.92);
}

body[data-theme="light"] .help-header,
body[data-theme="light"] .help-card,
body[data-theme="light"] .help-callout {
  background: rgba(245, 250, 255, 0.95);
}

body[data-theme="light"] .help-chip-btn,
body[data-theme="light"] .help-filter-btn {
  background: rgba(236, 245, 255, 0.95);
  color: #193a66;
}

body[data-theme="light"] .ads-rec-insight-card {
  background: rgba(243, 249, 255, 0.96);
  border-color: rgba(101, 136, 196, 0.34);
}

body[data-theme="light"] .ads-rec-insight-card header span {
  background: rgba(228, 239, 255, 0.92);
  color: #163964;
}

body[data-theme="light"] .ads-rec-insight-reason,
body[data-theme="light"] .ads-rec-insight-metrics {
  color: #335a88;
}

body[data-theme="light"] .help-checklist strong {
  color: #1a3c68;
}

body[data-theme="light"] .kpi {
  background: linear-gradient(145deg, rgba(226, 236, 255, 0.9), rgba(208, 223, 255, 0.9));
  border-color: rgba(87, 122, 186, 0.4);
}

body[data-theme="light"] .kpi-head strong {
  color: #123a64;
}

body[data-theme="light"] .kpi-track {
  background: rgba(137, 167, 219, 0.28);
}

body[data-theme="light"] .trend-chart {
  background: rgba(235, 245, 255, 0.95);
  border-color: rgba(99, 134, 194, 0.34);
}

body[data-theme="light"] .sales-kpi {
  background: linear-gradient(145deg, rgba(231, 240, 255, 0.94), rgba(216, 230, 255, 0.92));
  border-color: rgba(94, 130, 192, 0.34);
}

body[data-theme="light"] .kanban-col {
  background: rgba(246, 251, 255, 0.96);
  border-color: rgba(101, 136, 196, 0.32);
}

body[data-theme="light"] .kanban-col header span {
  background: rgba(204, 220, 247, 0.78);
  color: #21426e;
}

body[data-theme="light"] .kanban-item {
  background: rgba(227, 239, 255, 0.95);
  border-color: rgba(104, 139, 195, 0.3);
  color: #143660;
}

body[data-theme="light"] .kanban-item small,
body[data-theme="light"] .kanban-empty,
body[data-theme="light"] .preview-grid span,
body[data-theme="light"] .status-wrap .status-head {
  color: #3a5f8b;
}

body[data-theme="light"] .competitor-block {
  background: rgba(242, 249, 255, 0.95);
  border-color: rgba(108, 143, 201, 0.3);
}

body[data-theme="light"] .competitor-link {
  background: rgba(228, 240, 255, 0.95);
  border-color: rgba(103, 138, 196, 0.3);
  color: #163964;
}

body[data-theme="light"] .cell-main-text,
body[data-theme="light"] .review-actions button {
  color: #15365f;
}

body[data-theme="light"] .campaign-modal {
  background: rgba(24, 46, 78, 0.38);
}

body[data-theme="light"] .campaign-modal-card {
  background: linear-gradient(145deg, rgba(245, 251, 255, 0.98), rgba(226, 237, 255, 0.96));
  border-color: rgba(97, 132, 192, 0.4);
  color: #102848;
}

body[data-theme="light"] .campaign-close {
  background: rgba(238, 246, 255, 0.96);
  border-color: rgba(101, 136, 196, 0.38);
  color: #183e6c;
}

body[data-theme="light"] .campaign-modal .table-card,
body[data-theme="light"] .campaign-modal pre {
  background: rgba(249, 253, 255, 0.98);
  border-color: rgba(112, 146, 202, 0.34);
  color: #12355e;
}

body[data-theme="light"] .product-modal-section {
  background: rgba(242, 248, 255, 0.95);
  border-color: rgba(106, 141, 197, 0.34);
}

body[data-theme="light"] .product-kv-card {
  background: rgba(251, 254, 255, 0.98);
  border-color: rgba(112, 146, 202, 0.34);
}

body[data-theme="light"] .product-kv-card b {
  color: #1a3f6b;
}

body[data-theme="light"] .product-modal-description {
  background: rgba(250, 254, 255, 0.99);
  border-color: rgba(112, 146, 202, 0.34);
  color: #173b66;
}

body[data-theme="light"] .admin-user-profile-card {
  background: linear-gradient(145deg, rgba(242, 249, 255, 0.98), rgba(230, 240, 255, 0.96));
  border-color: rgba(100, 136, 194, 0.35);
  color: #153962;
}

body[data-theme="light"] .admin-chip {
  background: rgba(229, 240, 255, 0.95);
  border-color: rgba(103, 139, 197, 0.33);
  color: #153a64;
}

body[data-theme="light"] .admin-team-box .table-card {
  background: rgba(249, 253, 255, 0.98);
}

body[data-theme="light"] .admin-audit-kv b {
  color: #234a7a;
}

body[data-theme="light"] .hover-tip {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(108, 142, 197, 0.46);
  color: #163a66;
}

@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(32px, 32px, 0); }
}

@keyframes theme-float {
  0% { transform: translate3d(-10%, 0, 0); }
  100% { transform: translate3d(12%, 0, 0); }
}

@keyframes snow-shift {
  0% { transform: translate3d(0, -4%, 0); }
  100% { transform: translate3d(-8%, 8%, 0); }
}

@media (min-width: 981px) {
  .reviews-table,
  .questions-table,
  .reviews-table tbody,
  .questions-table tbody {
    display: block;
    width: 100%;
    min-width: 0 !important;
  }

  .reviews-table thead,
  .questions-table thead {
    display: none;
  }

  .reviews-table tr,
  .questions-table tr {
    display: block;
    border: 1px solid rgba(142, 172, 248, 0.3);
    border-radius: 12px;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: rgba(11, 22, 52, 0.62);
  }

  .reviews-table td,
  .questions-table td {
    display: block;
    border-bottom: 0;
    padding: 6px 4px;
  }

  .reviews-table td::before,
  .questions-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 4px;
  }

  .reviews-table td:empty::before,
  .questions-table td:empty::before {
    margin-bottom: 0;
  }

  .review-actions button {
    width: 38px;
    min-width: 38px;
    height: 36px;
  }
}

@media (max-width: 1200px) {
  .auth-hero { grid-template-columns: 1fr; }
  .landing-grid { grid-template-columns: 1fr; }
  .landing-band { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
  }
  /* Keep user workspace sidebar usable on medium screens: compact rail at left. */
  #appSection.app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
    --sidebar-width: 86px;
  }
  #appSection #mainSidebar {
    position: sticky;
    top: 12px;
    height: calc(100vh - 24px);
    padding: 12px 8px;
    gap: 10px;
  }
  #appSection #mainSidebar .brand p,
  #appSection #mainSidebar .nav-label {
    display: none;
  }
  #appSection #mainSidebar .brand h2 {
    font-size: 18px;
    text-align: center;
  }
  #appSection #mainSidebar .nav-btn {
    justify-content: center;
    padding-left: 8px;
    padding-right: 8px;
  }
  #appSection #mainSidebar .btn-danger.full {
    padding: 10px 6px;
    font-size: 12px;
  }
  .seo-split { grid-template-columns: 1fr; }
  .preview-card { position: static; }
  .kanban { grid-template-columns: 1fr 1fr; }
  .admin-team-create { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .auth-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .auth-toolbar-controls {
    width: 100%;
  }
  .auth-toolbar-controls .chip-btn,
  .auth-toolbar-controls .chip-select {
    flex: 1 1 0;
  }
  .auth-hero {
    display: flex;
    flex-direction: column;
  }
  .auth-grid {
    order: -1;
  }
  .auth-pitch {
    order: 1;
  }
  .auth-grid, .cols-2 { grid-template-columns: 1fr; }
  .product-row-actions {
    opacity: 1;
    pointer-events: auto;
  }
  .pitch-grid { grid-template-columns: 1fr; }
  .grid-6, .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .reviews-controls,
  .questions-controls,
  #reviews .panel > .grid-6:first-of-type,
  #reviewsSubtabQuestions .panel > .grid-6:first-of-type,
  .ads-toolbar-main,
  .ads-toolbar-filters,
  .ads-toolbar-meta,
  .ads-bidder-grid,
  .ads-bidder-actions {
    grid-template-columns: 1fr;
  }
  .sales-kpis { grid-template-columns: 1fr; }
  .sales-chart-controls { align-items: flex-start; }
  .products-pager {
    flex-direction: column;
    align-items: stretch;
  }
  .products-pager-left,
  .products-pager-right {
    justify-content: space-between;
    width: 100%;
  }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .mobile-nav-toggle { display: inline-flex; }
  #appSection.app-shell {
    display: grid;
    grid-template-columns: 1fr;
    padding: 0 8px 16px;
    margin: 0 auto;
  }
  #appSection .workspace {
    padding-top: 8px;
  }
  .topbar {
    padding: 10px;
    margin-bottom: 10px;
  }
  #appSection .workspace {
    min-height: auto;
  }
  #mainSidebar {
    position: fixed;
    top: 12px;
    left: 12px;
    bottom: 12px;
    height: auto;
    width: min(92vw, 360px);
    max-width: 100%;
    transform: translateX(-110%);
    z-index: 1200;
    box-shadow: 0 20px 50px rgba(6, 10, 28, 0.45);
    overflow-y: auto;
  }
  .app-shell.nav-open #mainSidebar {
    transform: translateX(0);
  }
  .app-shell.nav-open .mobile-nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  #mainSidebar .sidebar-toggle {
    display: none;
  }
  #mainSidebar .side-nav {
    display: grid;
    width: 100%;
    gap: 8px;
    overflow: visible;
  }
  #mainSidebar .nav-btn {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
  }
  #mainSidebar .nav-label {
    display: block;
  }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-controls { width: 100%; }
  .topbar-controls .chip-select { width: 100%; border-radius: 12px; }
  .help-card-head { flex-direction: column; }
  .help-card-actions { width: 100%; }
  .admin-user-profile-grid { grid-template-columns: 1fr; }
  .admin-team-create { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .auth-wrap { padding: 12px; }
  .auth-card { padding: 16px; }
  .auth-card h1 { font-size: 32px; }
  .auth-card .lead { font-size: 16px; }
  .landing-grid,
  .landing-band {
    display: none;
  }
}

@keyframes busy-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}

/* Interface refresh: clearer block separation, stronger hierarchy, better readability. */
:root {
  --surface-0: rgba(7, 13, 32, 0.78);
  --surface-1: rgba(9, 18, 45, 0.84);
  --surface-2: rgba(12, 25, 60, 0.86);
  --surface-soft: rgba(19, 34, 78, 0.62);
  --surface-border: rgba(143, 176, 255, 0.34);
  --surface-border-strong: rgba(142, 206, 255, 0.55);
  --surface-shadow: 0 14px 34px rgba(2, 8, 28, 0.44);
}

body {
  line-height: 1.45;
  background:
    radial-gradient(circle at 14% 10%, rgba(51, 128, 255, 0.28), transparent 40%),
    radial-gradient(circle at 88% 8%, rgba(34, 212, 255, 0.2), transparent 34%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

.app-bg {
  opacity: 0.48;
  background-image:
    linear-gradient(rgba(138, 179, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138, 179, 255, 0.05) 1px, transparent 1px);
}

.app-shell {
  gap: 16px;
}

.sidebar {
  border-radius: 22px;
  border: 1px solid var(--surface-border);
  background:
    linear-gradient(180deg, rgba(8, 16, 40, 0.96), rgba(10, 23, 58, 0.92));
  box-shadow: var(--surface-shadow);
}

.workspace {
  border-radius: 22px;
  border: 1px solid var(--surface-border);
  background:
    radial-gradient(circle at 94% -8%, rgba(101, 155, 255, 0.2), transparent 32%),
    radial-gradient(circle at 8% 2%, rgba(38, 214, 255, 0.15), transparent 28%),
    linear-gradient(165deg, rgba(6, 13, 35, 0.92), rgba(8, 20, 52, 0.92));
  box-shadow: var(--surface-shadow);
  padding: 16px;
}

.topbar {
  padding: 14px 16px;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(12, 23, 56, 0.82), rgba(15, 33, 80, 0.78));
  margin-bottom: 10px;
}

.topbar h1 {
  letter-spacing: 0.01em;
}

.panel,
.table-card,
.kpi,
.sales-kpi,
.preview-card,
.kanban-col,
.help-card,
.help-header,
.landing-card,
.landing-band,
.auth-card,
.auth-pitch,
.auth-box,
.ads-rec-kv,
.admin-user-profile-card,
.team-member-row,
.team-modal-card {
  border: 1px solid var(--surface-border);
  box-shadow: 0 10px 26px rgba(3, 10, 31, 0.36);
}

#appSection .tab:not(.hidden) .panel,
#appSection .tab:not(.hidden) .table-card,
#adminPanelSection .admin-tab:not(.hidden) .panel,
#adminPanelSection .admin-tab:not(.hidden) .table-card {
  animation: panel-rise 0.32s ease-out both;
}

.panel,
.table-card,
.help-card,
.help-header,
.preview-card,
.kanban-col,
.ads-rec-kv,
.team-member-row,
.team-modal-card,
.admin-user-profile-card {
  background:
    linear-gradient(150deg, var(--surface-1), var(--surface-2));
}

.panel {
  border-radius: 16px;
  padding: 13px;
  margin-bottom: 11px;
}

.table-card {
  border-radius: 15px;
  overflow: hidden;
}

.panel h3,
.panel h4,
.help-card h4,
.help-header h4,
.landing-card h3,
.auth-card h1,
.auth-card h3 {
  letter-spacing: 0.01em;
}

.kpi,
.sales-kpi {
  border-radius: 14px;
  background:
    linear-gradient(155deg, rgba(14, 30, 72, 0.96), rgba(18, 38, 91, 0.9));
}

.kpi-head strong {
  color: #b7f1ff;
}

table th {
  background: rgba(15, 29, 72, 0.9);
  border-bottom: 1px solid rgba(141, 174, 255, 0.42);
  letter-spacing: 0.04em;
}

table td {
  border-bottom: 1px solid rgba(133, 165, 255, 0.2);
}

tbody tr:hover {
  background: rgba(27, 49, 112, 0.26);
}

input,
select,
textarea {
  background: linear-gradient(160deg, rgba(8, 17, 44, 0.95), rgba(11, 25, 61, 0.9));
  border: 1px solid rgba(132, 167, 255, 0.34);
  border-radius: 11px;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(186, 219, 255, 0.08);
}

input::placeholder,
textarea::placeholder {
  color: #8ea7da;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--surface-border-strong);
  box-shadow:
    0 0 0 2px rgba(78, 172, 255, 0.18),
    inset 0 1px 0 rgba(186, 219, 255, 0.08);
}

button,
.btn-secondary,
.btn-danger,
.chip-btn,
.chip-select {
  border-radius: 11px;
}

button,
.btn-secondary {
  border: 1px solid rgba(132, 167, 255, 0.34);
  background: linear-gradient(140deg, rgba(18, 41, 92, 0.92), rgba(25, 56, 120, 0.86));
  box-shadow: 0 8px 20px rgba(4, 11, 35, 0.32);
}

button:hover,
.btn-secondary:hover {
  border-color: rgba(147, 227, 255, 0.65);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(140deg, rgba(167, 33, 73, 0.92), rgba(212, 72, 110, 0.88));
  border-color: rgba(255, 133, 161, 0.48);
}

.chip-btn {
  border: 1px solid rgba(133, 165, 255, 0.34);
  background: rgba(13, 31, 77, 0.76);
}

.chip-btn.active {
  border-color: rgba(126, 229, 255, 0.66);
  background: linear-gradient(140deg, rgba(23, 117, 173, 0.56), rgba(38, 154, 172, 0.52));
}

.module-subtabs {
  gap: 9px;
  padding-bottom: 2px;
}

.products-catalog-wrap .table-card,
.seo-split .table-card,
.reviews-wrap .table-card,
.questions-wrap .table-card {
  background:
    linear-gradient(155deg, rgba(8, 18, 46, 0.94), rgba(12, 30, 72, 0.88));
}

.products-pager {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(132, 166, 255, 0.2);
  background: rgba(11, 22, 55, 0.5);
}

.team-member-row {
  border-radius: 15px;
  padding: 13px 14px;
}

.team-member-role {
  border-color: rgba(135, 206, 255, 0.55);
  background: rgba(18, 42, 96, 0.65);
}

.team-row-edit {
  background: linear-gradient(145deg, rgba(17, 52, 112, 0.94), rgba(30, 87, 170, 0.88));
  border-color: rgba(131, 214, 255, 0.58);
}

.team-modal {
  background: rgba(4, 9, 24, 0.86);
  backdrop-filter: blur(4px);
}

.team-modal-card {
  border-radius: 18px;
  padding: 14px;
}

.auth-wrap {
  padding: 24px;
}

.auth-toolbar {
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(9, 21, 54, 0.88), rgba(13, 33, 82, 0.82));
  box-shadow: var(--surface-shadow);
}

.auth-card {
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 6%, rgba(78, 147, 255, 0.22), transparent 28%),
    linear-gradient(145deg, rgba(9, 20, 50, 0.92), rgba(14, 32, 82, 0.9));
}

.auth-pitch,
.auth-box,
.landing-card,
.landing-band {
  border-radius: 18px;
  background:
    linear-gradient(150deg, rgba(9, 19, 47, 0.86), rgba(14, 31, 78, 0.84));
}

.landing-card p,
.landing-band p,
.pitch-note,
.faq-list {
  color: #d0e0ff;
}

.landing-chart {
  border-color: rgba(132, 170, 255, 0.36);
  background: rgba(7, 17, 43, 0.78);
}

.bar-item .line {
  background: rgba(105, 138, 223, 0.32);
}

.help-card-head {
  border-bottom: 1px solid rgba(138, 173, 255, 0.26);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.help-card-body {
  color: #dce8ff;
}

.help-callout.main {
  border-color: rgba(93, 216, 255, 0.5);
  background: rgba(16, 74, 97, 0.34);
}

.help-callout.warn {
  border-color: rgba(255, 177, 142, 0.5);
  background: rgba(104, 56, 30, 0.3);
}

/* Admin keeps the same design language but with stronger readability for dense tables. */
#adminPanelSection .workspace .panel,
#adminPanelSection .workspace .table-card {
  background:
    linear-gradient(150deg, rgba(11, 20, 50, 0.93), rgba(16, 33, 82, 0.9));
}

#adminPanelSection .kpis {
  gap: 10px;
}

#adminPanelSection table th {
  font-size: 12px;
}

#adminPanelSection .hint {
  color: #bcd0ff;
}

body[data-theme="light"] {
  --surface-0: rgba(252, 255, 255, 0.95);
  --surface-1: rgba(247, 252, 255, 0.95);
  --surface-2: rgba(236, 245, 255, 0.95);
  --surface-soft: rgba(235, 245, 255, 0.84);
  --surface-border: rgba(95, 131, 194, 0.32);
  --surface-border-strong: rgba(64, 150, 209, 0.52);
  --surface-shadow: 0 12px 28px rgba(63, 93, 144, 0.2);
}

body[data-theme="light"] .workspace,
body[data-theme="light"] .sidebar,
body[data-theme="light"] .panel,
body[data-theme="light"] .table-card,
body[data-theme="light"] .auth-card,
body[data-theme="light"] .auth-pitch,
body[data-theme="light"] .auth-box,
body[data-theme="light"] .landing-card,
body[data-theme="light"] .landing-band,
body[data-theme="light"] .team-member-row,
body[data-theme="light"] .team-modal-card {
  color: #133157;
}

body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 255, 0.96));
  border-color: rgba(103, 137, 194, 0.35);
  color: #173a65;
}

body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder {
  color: #53759f;
}

@media (max-width: 1200px) {
  .workspace {
    border-radius: 18px;
    padding: 12px;
  }
  .topbar {
    padding: 12px;
  }
}

@media (max-width: 980px) {
  .panel,
  .table-card,
  .auth-card,
  .landing-card,
  .landing-band {
    border-radius: 14px;
  }
  #mainSidebar {
    border-color: rgba(131, 171, 255, 0.45);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
  }
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 2026-03 dashboard redesign based on analytics-focused references. */
:root {
  --ds-bg: #f1f4f9;
  --ds-bg-2: #e9eef7;
  --ds-surface: #ffffff;
  --ds-surface-2: #f8fbff;
  --ds-surface-soft: #f3f7ff;
  --ds-sidebar: #15253c;
  --ds-sidebar-2: #1b3354;
  --ds-border: #d7e1ef;
  --ds-border-strong: #bfcee4;
  --ds-text: #152033;
  --ds-muted: #6c7a94;
  --ds-accent: #2f8cff;
  --ds-accent-2: #0fb7d3;
  --ds-ok: #1ea97c;
  --ds-danger: #e74f6f;
  --ds-shadow: 0 8px 24px rgba(31, 56, 91, 0.11);
  --ds-shadow-strong: 0 16px 36px rgba(22, 43, 76, 0.17);
}

body[data-theme="classic"] {
  --ds-bg: #eef2fa;
  --ds-bg-2: #e5ebf7;
  --ds-surface: #ffffff;
  --ds-surface-2: #f9fbff;
  --ds-surface-soft: #f3f8ff;
  --ds-sidebar: #132844;
  --ds-sidebar-2: #1b3960;
  --ds-border: #d5dfed;
  --ds-border-strong: #bed0e5;
  --ds-text: #102038;
  --ds-muted: #667795;
  --ds-accent: #2d89f6;
  --ds-accent-2: #13b8d5;
}

body[data-theme="dark"] {
  --ds-bg: #0a111d;
  --ds-bg-2: #121d31;
  --ds-surface: #132339;
  --ds-surface-2: #172a45;
  --ds-surface-soft: #1d3354;
  --ds-sidebar: #0b1628;
  --ds-sidebar-2: #162e4c;
  --ds-border: #243e61;
  --ds-border-strong: #33537d;
  --ds-text: #e6efff;
  --ds-muted: #a9bddf;
  --ds-accent: #4aa6ff;
  --ds-accent-2: #35c7df;
  --ds-shadow: 0 10px 24px rgba(2, 8, 18, 0.4);
  --ds-shadow-strong: 0 18px 36px rgba(2, 8, 18, 0.48);
}

body[data-theme="light"] {
  --ds-bg: #f4f7fc;
  --ds-bg-2: #eaf0fa;
  --ds-surface: #ffffff;
  --ds-surface-2: #fbfdff;
  --ds-surface-soft: #f4f8ff;
  --ds-sidebar: #183254;
  --ds-sidebar-2: #25466f;
  --ds-border: #d9e4f3;
  --ds-border-strong: #c4d4e9;
  --ds-text: #14233d;
  --ds-muted: #677a97;
  --ds-accent: #2e8df7;
  --ds-accent-2: #22bfd2;
}

body[data-theme="moon"] {
  --ds-bg: #e8edf5;
  --ds-bg-2: #dee5f0;
  --ds-surface: #f7f9fd;
  --ds-surface-2: #f2f6fd;
  --ds-surface-soft: #edf2fa;
  --ds-sidebar: #2c3c53;
  --ds-sidebar-2: #3f506b;
  --ds-border: #ccd6e4;
  --ds-border-strong: #b9c5d6;
  --ds-text: #1d2f49;
  --ds-muted: #6e7f97;
  --ds-accent: #4f89d8;
  --ds-accent-2: #5eb4c6;
}

body[data-theme="newyear"] {
  --ds-bg: #f6f4ef;
  --ds-bg-2: #f0ece2;
  --ds-surface: #fffdf8;
  --ds-surface-2: #fff8ef;
  --ds-surface-soft: #fef4e7;
  --ds-sidebar: #3f2230;
  --ds-sidebar-2: #603244;
  --ds-border: #ead8cb;
  --ds-border-strong: #dcc5b2;
  --ds-text: #362022;
  --ds-muted: #7f6663;
  --ds-accent: #d95168;
  --ds-accent-2: #44ab8f;
}

body[data-theme="summer"] {
  --ds-bg: #ebf7f9;
  --ds-bg-2: #def0f3;
  --ds-surface: #ffffff;
  --ds-surface-2: #f6fdff;
  --ds-surface-soft: #effbff;
  --ds-sidebar: #0f3651;
  --ds-sidebar-2: #13607b;
  --ds-border: #cfe5ea;
  --ds-border-strong: #bdd9df;
  --ds-text: #17334b;
  --ds-muted: #5e7c91;
  --ds-accent: #0f8cc5;
  --ds-accent-2: #14b8a8;
}

body[data-theme="autumn"] {
  --ds-bg: #f6f0ea;
  --ds-bg-2: #efe4da;
  --ds-surface: #fffaf4;
  --ds-surface-2: #fff5ea;
  --ds-surface-soft: #ffefe0;
  --ds-sidebar: #3a261a;
  --ds-sidebar-2: #5d3a29;
  --ds-border: #e5d3c2;
  --ds-border-strong: #d8bfa8;
  --ds-text: #402a1e;
  --ds-muted: #826958;
  --ds-accent: #b76934;
  --ds-accent-2: #db8e42;
}

body[data-theme="winter"] {
  --ds-bg: #edf4fb;
  --ds-bg-2: #e4edf7;
  --ds-surface: #fdfefe;
  --ds-surface-2: #f5faff;
  --ds-surface-soft: #ecf5ff;
  --ds-sidebar: #1a3559;
  --ds-sidebar-2: #295180;
  --ds-border: #d2e1f0;
  --ds-border-strong: #bdd2e6;
  --ds-text: #193149;
  --ds-muted: #657f98;
  --ds-accent: #357edb;
  --ds-accent-2: #3bb6ce;
}

body[data-theme="spring"] {
  --ds-bg: #edf8f2;
  --ds-bg-2: #e3f1e8;
  --ds-surface: #fbfffd;
  --ds-surface-2: #f3fbf6;
  --ds-surface-soft: #edf8f0;
  --ds-sidebar: #1f3940;
  --ds-sidebar-2: #356052;
  --ds-border: #d2e4d9;
  --ds-border-strong: #bfd7ca;
  --ds-text: #1e342f;
  --ds-muted: #637f77;
  --ds-accent: #278b62;
  --ds-accent-2: #4baf8a;
}

body[data-theme="japan"] {
  --ds-bg: #f7eff6;
  --ds-bg-2: #efe3ee;
  --ds-surface: #fffaff;
  --ds-surface-2: #fdf5fc;
  --ds-surface-soft: #fbeef9;
  --ds-sidebar: #3b2740;
  --ds-sidebar-2: #5f3d69;
  --ds-border: #e4d3e4;
  --ds-border-strong: #d7c0d7;
  --ds-text: #3b2940;
  --ds-muted: #7b6580;
  --ds-accent: #b64d95;
  --ds-accent-2: #6d8ccf;
}

body[data-theme="greenland"] {
  --ds-bg: #eef8fa;
  --ds-bg-2: #e2f0f3;
  --ds-surface: #fbfeff;
  --ds-surface-2: #f3fafd;
  --ds-surface-soft: #ecf7fb;
  --ds-sidebar: #21435f;
  --ds-sidebar-2: #316588;
  --ds-border: #cfe2eb;
  --ds-border-strong: #bdd5e2;
  --ds-text: #1d3a53;
  --ds-muted: #668299;
  --ds-accent: #2f88b5;
  --ds-accent-2: #3fb1b4;
}

body {
  font-family: "IBM Plex Sans", "Manrope", sans-serif;
  color: var(--ds-text);
  background:
    radial-gradient(circle at 10% -10%, color-mix(in oklab, var(--ds-accent) 12%, transparent), transparent 42%),
    linear-gradient(165deg, var(--ds-bg), var(--ds-bg-2));
}

.app-bg {
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(88, 123, 170, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 123, 170, 0.1) 1px, transparent 1px);
  mask-image: none;
  animation: none;
}

.auth-toolbar,
.auth-card,
.auth-pitch,
.auth-box,
.landing-card,
.landing-band,
.sidebar,
.workspace,
.topbar,
.panel,
.table-card,
.kpi,
.sales-kpi,
.help-card,
.help-header,
.team-member-row,
.team-modal-card,
.admin-user-profile-card,
.campaign-modal-card {
  border: 1px solid var(--ds-border);
  border-radius: 14px;
  box-shadow: var(--ds-shadow);
}

.auth-toolbar {
  background: var(--ds-surface);
}

.auth-toolbar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  margin-right: 10px;
}

.auth-toolbar-nav a {
  color: var(--ds-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
}

.auth-toolbar-nav a:hover {
  color: var(--ds-text);
  background: var(--ds-surface-soft);
}

.auth-card,
.auth-pitch,
.auth-box,
.landing-card,
.landing-band {
  background: var(--ds-surface);
}

.auth-pitch {
  border-top: 4px solid color-mix(in oklab, var(--ds-accent) 70%, white);
}

.logo-b {
  background: linear-gradient(102deg, var(--ds-accent), var(--ds-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-card .lead,
.pitch-grid ul,
.pitch-grid ol,
.landing-card p,
.landing-band p {
  color: var(--ds-muted);
}

.auth-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.auth-proof > div {
  border: 1px solid var(--ds-border);
  border-radius: 10px;
  background: var(--ds-surface-soft);
  padding: 8px 10px;
  display: grid;
  gap: 2px;
}

.auth-proof b {
  font-size: 14px;
}

.auth-proof span {
  color: var(--ds-muted);
  font-size: 12px;
}

.partners span {
  border-color: var(--ds-border);
  color: var(--ds-text);
  background: var(--ds-surface-soft);
}

.landing-chart {
  border-color: var(--ds-border-strong);
  background: linear-gradient(180deg, var(--ds-surface-soft), color-mix(in oklab, var(--ds-surface-soft) 70%, #fff));
}

.landing-chart i,
.bar-item .line i,
.kpi-track i {
  background: linear-gradient(90deg, var(--ds-accent), var(--ds-accent-2));
}

.app-shell {
  max-width: min(1900px, calc(100vw - 8px));
  gap: 12px;
}

.sidebar {
  background: linear-gradient(180deg, var(--ds-sidebar), var(--ds-sidebar-2));
  border-color: color-mix(in oklab, var(--ds-sidebar) 65%, #5a7dab);
  box-shadow: var(--ds-shadow-strong);
}

.sidebar .brand p,
.sidebar .nav-label,
.sidebar .nav-icon {
  color: #d8e7ff;
}

.nav-btn {
  background: color-mix(in oklab, var(--ds-sidebar-2) 70%, #123153);
  border: 1px solid color-mix(in oklab, var(--ds-sidebar) 58%, #6a90be);
  color: #eff5ff;
  font-weight: 600;
}

.nav-btn:hover {
  border-color: #8bb8ec;
  background: color-mix(in oklab, var(--ds-sidebar-2) 80%, #1d436f);
}

.nav-btn.active {
  border-color: color-mix(in oklab, var(--ds-accent) 55%, #b5d7ff);
  background: linear-gradient(
    120deg,
    color-mix(in oklab, var(--ds-accent) 36%, transparent),
    color-mix(in oklab, var(--ds-accent-2) 26%, transparent)
  );
}

.workspace {
  background: var(--ds-surface-2);
  border-color: var(--ds-border);
  min-height: calc(100vh - 28px);
}

.topbar {
  background: var(--ds-surface);
  border-color: var(--ds-border);
  position: sticky;
  top: 10px;
  z-index: 20;
  box-shadow: 0 6px 18px rgba(27, 53, 85, 0.08);
}

.topbar h1 {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  color: var(--ds-text);
}

.topbar p,
.hint,
.trend-meta,
.sales-kpi span,
.kpi-head span {
  color: var(--ds-muted);
}

.panel,
.table-card,
.help-card,
.help-header,
.team-member-row,
.campaign-modal-card,
.team-modal-card {
  background: var(--ds-surface);
  border-color: var(--ds-border);
}

.panel {
  border-top-width: 3px;
  border-top-color: color-mix(in oklab, var(--ds-accent) 34%, var(--ds-border));
  padding: 12px;
}

.kpi {
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--ds-accent) 32%, #362f64),
    color-mix(in oklab, var(--ds-accent-2) 24%, #284f73)
  );
  color: #f4f8ff;
  border-color: transparent;
}

.kpi .kpi-head span {
  color: rgba(233, 244, 255, 0.8);
}

.kpi .kpi-head strong {
  color: #ffffff;
}

.sales-kpi {
  background: var(--ds-surface-soft);
  border-color: var(--ds-border);
}

.sales-kpi strong {
  color: var(--ds-text);
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid var(--ds-border-strong);
  color: var(--ds-text);
  border-radius: 8px;
  font-size: 14px;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in oklab, var(--ds-muted) 75%, #9da9bb);
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in oklab, var(--ds-accent) 62%, #79aeee);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ds-accent) 18%, transparent);
}

button,
.btn-secondary,
.btn-danger,
.chip-btn,
.chip-select {
  border-radius: 8px;
  font-weight: 600;
}

button,
.btn-secondary {
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  border: 1px solid var(--ds-border-strong);
  color: var(--ds-text);
  box-shadow: 0 3px 10px rgba(36, 56, 92, 0.08);
}

button:hover,
.btn-secondary:hover {
  border-color: color-mix(in oklab, var(--ds-accent) 55%, #bfd1e7);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(180deg, #ff7b92, #e95b77);
  border-color: #d14b65;
  color: #fff;
}

.chip-btn {
  background: #fff;
  border: 1px solid var(--ds-border-strong);
  color: var(--ds-text);
}

.chip-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(105deg, var(--ds-accent), var(--ds-accent-2));
}

.chip-select {
  background: #fff;
  border: 1px solid var(--ds-border-strong);
  color: var(--ds-text);
}

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--ds-surface);
  color: var(--ds-text);
}

table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ds-surface-soft);
  color: color-mix(in oklab, var(--ds-text) 85%, #33425a);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ds-border-strong);
}

table td,
table th {
  border-right: 1px solid color-mix(in oklab, var(--ds-border) 80%, #edf2fb);
  padding: 9px 10px;
}

table td:last-child,
table th:last-child {
  border-right: 0;
}

tbody tr:nth-child(even) td {
  background: color-mix(in oklab, var(--ds-surface) 88%, var(--ds-surface-soft));
}

tbody tr:hover td {
  background: color-mix(in oklab, var(--ds-accent) 8%, var(--ds-surface));
}

.products-pager,
.admin-audit-pager {
  background: var(--ds-surface-soft);
  border: 1px solid var(--ds-border);
  border-radius: 10px;
}

.trend-panel {
  background: var(--ds-surface);
}

.trend-chart {
  border: 1px solid var(--ds-border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(rgba(113, 146, 192, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 146, 192, 0.06) 1px, transparent 1px),
    var(--ds-surface-soft);
  background-size: 26px 26px, 26px 26px, auto;
}

.trend-chart svg,
.trend-chart canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.ads-rec-kv,
.keyword-item,
.help-block,
.help-callout,
.team-access-picks .check {
  background: var(--ds-surface-soft);
  border-color: var(--ds-border);
}

.team-member-row {
  border-left: 4px solid color-mix(in oklab, var(--ds-accent) 55%, #84b8ef);
}

.team-row-edit {
  background: linear-gradient(180deg, var(--ds-accent), color-mix(in oklab, var(--ds-accent) 70%, #1f74cf));
  color: #fff;
  border-color: transparent;
}

.help-card.selected {
  border-color: color-mix(in oklab, var(--ds-accent) 45%, #afc8e5);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ds-accent) 13%, transparent), var(--ds-shadow);
}

.review-type-pill {
  background: color-mix(in oklab, var(--ds-accent) 16%, #f0f6ff);
  color: color-mix(in oklab, var(--ds-accent) 70%, #2f4f7a);
  border: 1px solid color-mix(in oklab, var(--ds-accent) 22%, #c1d6ef);
}

/* Restore classic tabular view for reviews/questions on desktop. */
@media (min-width: 981px) {
  .reviews-table,
  .questions-table,
  .reviews-table tbody,
  .questions-table tbody {
    display: table;
    width: 100%;
  }

  .reviews-table thead,
  .questions-table thead {
    display: table-header-group;
  }

  .reviews-table tr,
  .questions-table tr {
    display: table-row;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
    background: transparent;
  }

  .reviews-table td,
  .questions-table td {
    display: table-cell;
    border-bottom: 1px solid var(--ds-border);
    padding: 8px 9px;
    vertical-align: top;
  }

  .reviews-table td::before,
  .questions-table td::before {
    content: none;
    display: none;
  }
}

@media (max-width: 1200px) {
  .kpis {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .workspace {
    padding: 12px;
  }

  .auth-toolbar-nav {
    display: none;
  }
}

@media (max-width: 980px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .topbar {
    position: static;
  }

  .panel,
  .table-card {
    border-radius: 10px;
  }

  .auth-proof {
    grid-template-columns: 1fr;
  }
}

/* 2026-03 redesign v2: high-contrast analytics layout across landing/app/admin. */
:root {
  --ux-radius-lg: 16px;
  --ux-radius-md: 12px;
  --ux-radius-sm: 9px;
  --ux-gap: 12px;
}

body {
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  align-items: stretch;
  gap: 14px;
}

.workspace {
  display: grid;
  gap: 12px;
  align-content: start;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--ds-surface-2) 86%, #ffffff), var(--ds-surface-2));
  padding: 14px;
}

#appSection .tab:not(.hidden),
#adminPanelSection .admin-tab:not(.hidden) {
  display: grid;
  gap: 12px;
  align-content: start;
  animation: panel-rise 0.3s ease-out both;
}

.topbar {
  border-radius: var(--ux-radius-lg);
  border: 1px solid var(--ds-border);
  background:
    linear-gradient(
      180deg,
      color-mix(in oklab, var(--ds-surface) 95%, #ffffff),
      color-mix(in oklab, var(--ds-surface) 88%, var(--ds-surface-soft))
    );
}

.topbar h1 {
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.1;
}

.topbar p {
  font-size: 14px;
}

.sidebar {
  border-radius: 20px;
  padding: 14px;
}

.sidebar .brand h2 {
  font-size: 27px;
}

.side-nav {
  gap: 7px;
}

.nav-btn {
  border-radius: 11px;
  min-height: 44px;
}

.nav-btn.active {
  box-shadow: inset 0 0 0 1px rgba(236, 247, 255, 0.22);
}

.panel,
.table-card,
.preview-card,
.help-card,
.help-header,
.campaign-modal-card,
.team-modal-card,
.admin-user-profile-card {
  border-radius: var(--ux-radius-lg);
  border: 1px solid var(--ds-border);
  background: var(--ds-surface);
}

.panel {
  border-top: 3px solid color-mix(in oklab, var(--ds-accent) 34%, var(--ds-border));
  padding: 12px;
  gap: 8px;
}

.table-card {
  padding: 0;
}

.table-card > table {
  border-radius: 0;
}

#products .panel .grid-6,
#products .panel .grid-5,
#products .panel .grid-4,
#products .panel .grid-3,
#products .panel .grid-2,
#reviews .panel .grid-6,
#reviews .panel .grid-5,
#reviews .panel .grid-4,
#reviewsSubtabQuestions .panel .grid-6,
#reviewsSubtabQuestions .panel .grid-5,
#reviewsSubtabQuestions .panel .grid-4,
#reviewsSubtabReturns .panel .grid-4,
#ads .panel .grid-6,
#ads .panel .grid-5,
#ads .panel .grid-4,
#sales .panel .grid-4,
#profile .panel .grid-3,
#help .panel .grid-4 {
  border: 1px solid var(--ds-border);
  border-radius: var(--ux-radius-md);
  padding: 9px;
  background: color-mix(in oklab, var(--ds-surface-soft) 85%, #ffffff);
}

.products-pager,
.admin-audit-pager {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: color-mix(in oklab, var(--ds-surface-soft) 88%, #ffffff);
}

.products-pager.products-pager-top {
  border-top: 0;
}

.products-pager.products-pager-bottom {
  border-bottom: 0;
}

table {
  min-width: 860px;
}

table thead th {
  top: 0;
  background: color-mix(in oklab, var(--ds-surface-soft) 92%, #ffffff);
  color: color-mix(in oklab, var(--ds-text) 84%, #344968);
  font-weight: 700;
}

table td {
  color: var(--ds-text);
  vertical-align: middle;
}

.products-table td,
.reviews-table td,
.questions-table td,
.ads-table td,
.sales-table td,
.seo-table td {
  font-size: 13px;
}

tbody tr.selected-row td {
  background: color-mix(in oklab, var(--ds-accent) 13%, var(--ds-surface));
}

.review-reply-input {
  min-height: 118px;
  line-height: 1.45;
  font-size: 13px;
}

.review-actions button,
.icon-action-btn {
  border-radius: 8px;
  border: 1px solid var(--ds-border-strong);
  background: linear-gradient(180deg, #ffffff, #eff5ff);
  color: var(--ds-text);
}

.review-actions button:hover,
.icon-action-btn:hover {
  border-color: color-mix(in oklab, var(--ds-accent) 52%, var(--ds-border-strong));
}

.trend-panel {
  padding-bottom: 10px;
}

.trend-chart {
  border: 1px solid var(--ds-border);
  border-radius: var(--ux-radius-md);
  background:
    linear-gradient(rgba(97, 125, 166, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(97, 125, 166, 0.07) 1px, transparent 1px),
    color-mix(in oklab, var(--ds-surface-soft) 88%, #ffffff);
  background-size: 24px 24px, 24px 24px, auto;
}

.kpis {
  gap: 10px;
}

.kpi {
  border-radius: 13px;
  padding: 12px;
}

.kpi .kpi-head strong {
  font-size: clamp(21px, 1.9vw, 28px);
}

.sales-kpis {
  gap: 10px;
}

.sales-kpi {
  border-radius: 12px;
  border: 1px solid var(--ds-border);
}

.sales-kpi strong {
  font-variant-numeric: tabular-nums;
}

.status-wrap {
  border-radius: 10px;
  border: 1px solid var(--ds-border);
  background: color-mix(in oklab, var(--ds-surface-soft) 78%, #ffffff);
}

.keyword-item,
.ads-rec-kv,
.ads-rec-insight-card,
.help-callout,
.help-block,
.team-access-picks .check {
  border-radius: 10px;
}

.help-card-head {
  margin-bottom: 10px;
}

.help-card-head h4 {
  font-size: 20px;
}

.help-card-body,
.help-block p,
.help-block li,
.help-checklist ol {
  color: var(--ds-text);
}

.team-member-list {
  gap: 10px;
}

.team-member-row {
  border-radius: 14px;
  padding: 12px 13px;
  transition: box-shadow 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.team-member-row:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--ds-accent) 28%, var(--ds-border));
  box-shadow: 0 12px 24px rgba(26, 52, 86, 0.14);
}

.team-member-row-main {
  gap: 8px 12px;
}

.team-member-identity strong {
  font-size: 16px;
}

.team-member-role {
  background: color-mix(in oklab, var(--ds-surface-soft) 88%, #ffffff);
}

.team-row-edit {
  border-radius: 10px;
  width: 38px;
  height: 38px;
}

.team-modal-card,
.campaign-modal-card {
  border-radius: 16px;
}

#adminPanelSection .workspace .panel,
#adminPanelSection .workspace .table-card {
  border-top-color: color-mix(in oklab, var(--ds-accent-2) 30%, var(--ds-border));
}

#adminPanelSection .kpi {
  background: linear-gradient(
    140deg,
    color-mix(in oklab, var(--ds-accent) 30%, #3a375f),
    color-mix(in oklab, var(--ds-accent-2) 30%, #2f5973)
  );
}

#adminPanelSection .bar-item .line {
  height: 10px;
}

#adminPanelSection pre {
  border-radius: 10px;
  border: 1px solid var(--ds-border);
  background: color-mix(in oklab, var(--ds-surface-soft) 78%, #ffffff);
  color: var(--ds-text);
}

table .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

table .actions button {
  min-height: 34px;
  padding: 7px 10px;
}

.auth-wrap {
  padding: 18px;
}

.auth-toolbar {
  border-radius: 14px;
  background: color-mix(in oklab, var(--ds-surface) 94%, #ffffff);
}

.auth-card {
  border-radius: 20px;
  overflow: hidden;
}

.auth-hero {
  gap: 12px;
}

.auth-pitch {
  border-top-width: 3px;
}

.auth-proof {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.landing-grid {
  gap: 10px;
}

.landing-card {
  border-top: 3px solid color-mix(in oklab, var(--ds-accent-2) 25%, var(--ds-border));
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.landing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(31, 58, 95, 0.14);
}

.landing-band {
  border-top: 3px solid color-mix(in oklab, var(--ds-accent) 28%, var(--ds-border));
}

.landing-grid .landing-card:nth-child(1) {
  animation: panel-rise 0.26s ease-out both;
}

.landing-grid .landing-card:nth-child(2) {
  animation: panel-rise 0.34s ease-out both;
}

.landing-grid .landing-card:nth-child(3) {
  animation: panel-rise 0.42s ease-out both;
}

.landing-grid .landing-card:nth-child(4) {
  animation: panel-rise 0.5s ease-out both;
}

.chip-select,
.chip-btn,
button,
.btn-secondary,
.btn-danger {
  min-height: 38px;
}

body[data-theme="dark"] .workspace,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .table-card,
body[data-theme="dark"] .auth-card,
body[data-theme="dark"] .auth-pitch,
body[data-theme="dark"] .auth-box,
body[data-theme="dark"] .landing-card,
body[data-theme="dark"] .landing-band,
body[data-theme="dark"] .help-card,
body[data-theme="dark"] .team-member-row {
  color: #e9f1ff;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] button,
body[data-theme="dark"] .btn-secondary,
body[data-theme="dark"] .chip-btn,
body[data-theme="dark"] .chip-select {
  color: #e9f1ff;
  background: #1a2c46;
  border-color: #35557f;
}

body[data-theme="dark"] table thead th {
  background: #1a2f4d;
  color: #bcd0f1;
}

body[data-theme="dark"] tbody tr:nth-child(even) td {
  background: #152840;
}

body[data-theme="dark"] tbody tr:hover td {
  background: #1d3558;
}

@media (max-width: 1200px) {
  .workspace {
    padding: 12px;
    gap: 10px;
  }

  #products .panel .grid-6,
  #products .panel .grid-5,
  #products .panel .grid-4,
  #reviews .panel .grid-6,
  #reviewsSubtabQuestions .panel .grid-6,
  #ads .panel .grid-6,
  #ads .panel .grid-5 {
    padding: 8px;
  }
}

@media (max-width: 980px) {
  .workspace {
    border-radius: 14px;
  }

  #appSection .tab:not(.hidden),
  #adminPanelSection .admin-tab:not(.hidden) {
    gap: 10px;
  }

  .panel {
    padding: 10px;
  }

  .table-card {
    border-radius: 10px;
  }

  table {
    min-width: 620px;
  }

  .topbar h1 {
    font-size: 22px;
  }
}

/* 2026-03 readability pass: feedback cards + larger sales chart */
#salesTrendChart {
  height: 272px;
}

#reviews .feedback-row-card,
#reviewsSubtabQuestions .feedback-row-card {
  padding: 14px 15px;
  gap: 11px;
  border-radius: 15px;
  border: 1px solid color-mix(in oklab, var(--ds-border) 86%, #ffffff);
  background:
    linear-gradient(
      165deg,
      color-mix(in oklab, var(--ds-surface-soft) 70%, #ffffff),
      color-mix(in oklab, var(--ds-surface) 92%, #ffffff)
    );
}

#reviews .feedback-row-head,
#reviewsSubtabQuestions .feedback-row-head {
  align-items: center;
  gap: 10px;
}

#reviews .feedback-meta-badge,
#reviewsSubtabQuestions .feedback-meta-badge {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

#reviews .feedback-meta-badge.feedback-market-wb,
#reviewsSubtabQuestions .feedback-meta-badge.feedback-market-wb {
  background: color-mix(in oklab, #7a4dff 30%, #ffffff);
  border-color: color-mix(in oklab, #7a4dff 48%, var(--ds-border));
  color: color-mix(in oklab, #1b0d4f 74%, #ffffff);
}

#reviews .feedback-meta-badge.feedback-market-ozon,
#reviewsSubtabQuestions .feedback-meta-badge.feedback-market-ozon {
  background: color-mix(in oklab, #2ec5ff 26%, #ffffff);
  border-color: color-mix(in oklab, #2ec5ff 44%, var(--ds-border));
  color: color-mix(in oklab, #08386a 72%, #ffffff);
}

#reviews .feedback-meta-badge.feedback-date-wb,
#reviewsSubtabQuestions .feedback-meta-badge.feedback-date-wb {
  background: color-mix(in oklab, #7a4dff 20%, #ffffff);
  border-color: color-mix(in oklab, #7a4dff 40%, var(--ds-border));
  color: color-mix(in oklab, #23114f 76%, #ffffff);
}

#reviews .feedback-meta-badge.feedback-date-ozon,
#reviewsSubtabQuestions .feedback-meta-badge.feedback-date-ozon {
  background: color-mix(in oklab, #2ec5ff 20%, #ffffff);
  border-color: color-mix(in oklab, #2ec5ff 40%, var(--ds-border));
  color: color-mix(in oklab, #0e4f84 76%, #ffffff);
}

#reviews .feedback-meta-badge.feedback-rating-5,
#reviewsSubtabQuestions .feedback-meta-badge.feedback-rating-5 {
  background: color-mix(in oklab, #22c55e 24%, #ffffff);
  color: #116534;
}

#reviews .feedback-meta-badge.feedback-rating-4,
#reviewsSubtabQuestions .feedback-meta-badge.feedback-rating-4 {
  background: color-mix(in oklab, #84cc16 30%, #ffffff);
  color: #3f6212;
}

#reviews .feedback-meta-badge.feedback-rating-3,
#reviewsSubtabQuestions .feedback-meta-badge.feedback-rating-3 {
  background: color-mix(in oklab, #facc15 36%, #ffffff);
  color: #854d0e;
}

#reviews .feedback-meta-badge.feedback-rating-2,
#reviewsSubtabQuestions .feedback-meta-badge.feedback-rating-2 {
  background: color-mix(in oklab, #fb923c 34%, #ffffff);
  color: #9a3412;
}

#reviews .feedback-meta-badge.feedback-rating-1,
#reviewsSubtabQuestions .feedback-meta-badge.feedback-rating-1 {
  background: color-mix(in oklab, #ef4444 28%, #ffffff);
  color: #991b1b;
}

#reviews .feedback-product-line,
#reviewsSubtabQuestions .feedback-product-line,
#reviews .feedback-text-line,
#reviewsSubtabQuestions .feedback-text-line,
#reviews .feedback-reply-line,
#reviewsSubtabQuestions .feedback-reply-line {
  border: 1px solid color-mix(in oklab, var(--ds-border) 88%, #ffffff);
  border-radius: 11px;
  background: color-mix(in oklab, var(--ds-surface-soft) 86%, #ffffff);
  padding: 9px 10px;
}

#reviews .cell-main-text,
#reviewsSubtabQuestions .cell-main-text {
  line-height: 1.52;
  font-size: 14px;
  max-height: 280px;
}

#reviews .cell-main-text.feedback-customer-text,
#reviewsSubtabQuestions .cell-main-text.feedback-customer-text {
  font-weight: 700;
}

#reviews .review-reply-input,
#reviewsSubtabQuestions .review-reply-input {
  min-height: 128px;
  line-height: 1.5;
  font-size: 14px;
  background: color-mix(in oklab, var(--ds-surface-soft) 80%, #ffffff);
}

#reviews .feedback-actions-row,
#reviewsSubtabQuestions .feedback-actions-row {
  margin-top: 4px;
}

@media (max-width: 980px) {
  #salesTrendChart {
    height: 234px;
  }
  #reviews .feedback-row-card,
  #reviewsSubtabQuestions .feedback-row-card {
    padding: 11px 12px;
  }
  #reviews .cell-main-text,
  #reviewsSubtabQuestions .cell-main-text {
    font-size: 13px;
    max-height: 230px;
  }
}

/* 2026-03 contrast hardening: prevent low-contrast text in user/admin modules */
.panel,
.table-card,
.campaign-modal-card,
.product-modal-card,
.team-modal-card,
.admin-user-profile-card,
.auth-card,
.auth-pitch,
.auth-box,
.landing-card,
.landing-band {
  color: var(--ds-text);
}

.hint,
.cell-meta-small,
.auth-toolbar-subtitle,
.pitch-note,
.review small,
.product-kv-card span,
.product-edit-form-grid label > span,
.team-modal-grid label > span,
.team-modal-access > span {
  color: var(--ds-muted);
}

.auth-toolbar-title,
.auth-card h3,
.landing-card h3,
.landing-band h3,
.campaign-modal-head h3,
.team-modal-head h3,
.product-modal-section h4,
.product-kv-card b,
.help-card-head h4,
.help-card h4,
.table-card h3,
.panel h3,
.panel h4 {
  color: var(--ds-text);
}

.auth-card .lead,
.pitch-grid ul,
.pitch-grid ol,
.landing-card p,
.landing-band p,
.review strong,
.faq-list,
.help-card-body,
.help-block p,
.help-block li,
.help-checklist ol {
  color: color-mix(in oklab, var(--ds-text) 78%, var(--ds-muted));
}

#productViewModal .campaign-modal-card,
#productEditModal .campaign-modal-card,
#campaignDetailModal .campaign-modal-card,
#teamMemberEditModal .team-modal-card {
  color: var(--ds-text);
}

#productViewMeta,
#productViewWarn,
#productEditHint,
#teamMemberEditMeta,
#campaignDetailSummary {
  color: var(--ds-muted);
}

#productViewModal .product-modal-description,
#productEditModal .product-modal-description,
#productViewModal .product-modal-section,
#productEditModal .product-modal-section {
  color: var(--ds-text);
}

#productViewModal .product-modal-section,
#productEditModal .product-modal-section {
  background: color-mix(in oklab, var(--ds-surface-soft) 86%, #ffffff);
  border-color: color-mix(in oklab, var(--ds-border) 88%, #ffffff);
}

#productViewModal .product-kv-card,
#productEditModal .product-kv-card {
  background: color-mix(in oklab, var(--ds-surface) 92%, #ffffff);
  border-color: color-mix(in oklab, var(--ds-border) 88%, #ffffff);
}

.review-reply-input,
.feedback-text-line .cell-main-text,
.feedback-reply-line .cell-main-text,
.feedback-product-line .cell-main-text {
  color: var(--ds-text);
}

table td,
table th,
.products-table td,
.reviews-table td,
.questions-table td,
.sales-table td,
.ads-table td,
.seo-table td {
  color: var(--ds-text);
}

.admin-link {
  color: color-mix(in oklab, var(--ds-accent) 72%, #1f4f77);
}

/* 2026-03 admin usability: users popup editing + audit scrolling/contrast */
#adminTab-users .admin-user-row-actions {
  text-align: right;
  width: 132px;
}

#adminTab-users .admin-user-edit-btn {
  opacity: 0;
  pointer-events: none;
  transform: translateX(7px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

#adminTab-users tbody tr:hover .admin-user-edit-btn,
#adminTab-users tbody tr:focus-within .admin-user-edit-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

@media (hover: none) {
  #adminTab-users .admin-user-edit-btn {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

#adminUserEditModal .team-modal-card {
  width: min(1240px, 98vw);
}

#adminUserEditHost .admin-user-details {
  padding: 2px;
}

#adminUserEditHost .admin-user-core-actions {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

#adminUserEditHost .admin-user-core-actions .actions {
  justify-content: flex-end;
}

#adminUserEditHost .admin-team-head {
  align-items: center;
}

#adminUserEditHost .admin-team-head .actions {
  margin-left: auto;
  align-items: center;
}

#adminUserEditHost .admin-team-head .hint {
  margin-right: 6px;
}

#adminUserEditHost .admin-team-table-wrap {
  max-height: 360px;
  overflow: auto;
}

#adminUserEditHost .admin-team-table td:first-child strong {
  color: var(--ds-text);
}

#adminUserEditHost .admin-team-table td:first-child .hint {
  color: color-mix(in oklab, var(--ds-text) 68%, var(--ds-muted));
}

#adminUserEditHost .admin-team-table .admin-user-row-actions {
  width: 130px;
  text-align: right;
}

#adminUserEditHost .admin-team-table .admin-user-edit-btn {
  opacity: 0;
  pointer-events: none;
  transform: translateX(7px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

#adminUserEditHost .admin-team-table tbody tr:hover .admin-user-edit-btn,
#adminUserEditHost .admin-team-table tbody tr:focus-within .admin-user-edit-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

#adminTeamMemberModal .team-modal-card {
  width: min(960px, 96vw);
}

#adminTab-audit .table-card {
  max-height: 68vh;
  overflow: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#adminTab-audit .table-card > table {
  min-width: 1380px;
}

#adminTab-audit .panel {
  overflow: visible;
}

#adminTab-audit thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: color-mix(in oklab, var(--ds-surface-soft) 88%, #ffffff);
}

#adminTab-audit #adminAuditMeta,
#adminTab-audit #adminAuditPageInfo,
#adminTab-audit .admin-audit-kv,
#adminTab-audit .admin-audit-kv span {
  color: var(--ds-text) !important;
  opacity: 0.98;
}

#adminTab-audit .admin-audit-kv b {
  color: color-mix(in oklab, var(--ds-accent) 62%, var(--ds-text)) !important;
}

#adminTab-audit td,
#adminTab-audit td * {
  color: var(--ds-text);
}

#adminTab-appearance .panel h3,
#adminTab-appearance .hint,
#adminTab-appearance .check,
#adminTab-appearance label {
  color: var(--ds-text) !important;
  opacity: 1;
}

#adminTab-appearance .theme-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

#adminTab-appearance .theme-picks .check {
  padding: 6px 10px;
  border: 1px solid var(--ds-border);
  border-radius: 10px;
  background: color-mix(in oklab, var(--ds-surface-soft) 88%, #ffffff);
}

#adminTab-appearance pre {
  color: var(--ds-text);
}

#adminTab-appearance .panel,
#adminTab-ai .panel {
  background: color-mix(in oklab, var(--ds-surface) 90%, #ffffff);
}

@media (max-width: 980px) {
  #adminUserEditHost .admin-user-core-actions {
    grid-template-columns: 1fr;
  }
  #adminUserEditHost .admin-user-core-actions .actions {
    justify-content: flex-start;
  }
  #adminUserEditHost .admin-team-head {
    flex-direction: column;
    align-items: flex-start;
  }
  #adminUserEditHost .admin-team-head .actions {
    margin-left: 0;
  }
  #adminUserEditHost .admin-team-table .admin-user-edit-btn {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

/* 2026-03 profile menu + popup sections */
.profile-sections-panel {
  border-top-color: color-mix(in oklab, var(--ds-accent) 38%, var(--ds-border));
}

.profile-sections-intro {
  margin: 2px 0 10px;
  display: grid;
  gap: 2px;
}

.profile-sections-intro b {
  font-size: 14px;
  color: var(--ds-text);
}

.profile-sections-intro small {
  color: var(--ds-muted);
  font-size: 12px;
}

.profile-sections-list {
  display: grid;
  gap: 8px;
}

.profile-section-row {
  width: 100%;
  border: 1px solid var(--ds-border);
  border-radius: 12px;
  background: color-mix(in oklab, var(--ds-surface-soft) 88%, #ffffff);
  color: var(--ds-text);
  text-align: left;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.profile-section-row span {
  display: grid;
  gap: 2px;
}

.profile-section-row b {
  color: var(--ds-text);
  font-size: 15px;
}

.profile-section-row small {
  color: var(--ds-muted);
  font-size: 12px;
}

.profile-section-row i {
  font-style: normal;
  font-size: 12px;
  color: color-mix(in oklab, var(--ds-accent) 70%, var(--ds-text));
  border: 1px solid color-mix(in oklab, var(--ds-border) 86%, #ffffff);
  border-radius: 999px;
  padding: 4px 10px;
  background: color-mix(in oklab, var(--ds-surface) 88%, #ffffff);
  white-space: nowrap;
}

.profile-section-row:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--ds-accent) 42%, var(--ds-border));
  box-shadow: 0 10px 22px rgba(24, 46, 76, 0.12);
}

#profileSectionModal .profile-section-modal-card {
  width: min(1180px, 98vw);
}

#profileSectionModalHost > .panel {
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

#profileSectionModalHost .table-card {
  margin-top: 4px;
}

/* 2026-03 landing contrast stabilization */
.landing-card .review,
.landing-band .band-stats span {
  border-color: color-mix(in oklab, var(--ds-border) 88%, #ffffff);
  background: color-mix(in oklab, var(--ds-surface-soft) 86%, #ffffff);
}

.landing-card .review strong,
.landing-band .band-stats b {
  color: var(--ds-text);
}

.landing-card .review small,
.landing-band .band-stats span {
  color: color-mix(in oklab, var(--ds-text) 78%, var(--ds-muted));
}

body[data-theme="dark"] .landing-card .review,
body[data-theme="dark"] .landing-band .band-stats span {
  border-color: rgba(108, 137, 194, 0.42);
  background: rgba(15, 29, 52, 0.74);
}

/* 2026-03 admin AI/appearance readability */
#adminTab-ai .panel h3,
#adminTab-ai .hint,
#adminTab-ai th,
#adminTab-ai td,
#adminTab-appearance .panel h3,
#adminTab-appearance .hint,
#adminTab-appearance label,
#adminTab-appearance .check,
#adminTab-appearance th,
#adminTab-appearance td {
  color: var(--ds-text);
}

#adminTab-ai .hint,
#adminTab-appearance .hint {
  color: color-mix(in oklab, var(--ds-text) 72%, var(--ds-muted));
}

/* 2026-03 sales readability */
#salesTrendMeta,
#dashboardTrendMeta,
#salesStatsMeta,
#salesLoadStatus {
  color: color-mix(in oklab, var(--ds-text) 74%, var(--ds-muted));
}

#salesTrendMeta b,
#dashboardTrendMeta b {
  color: var(--ds-text);
}

#salesTrendMeta .trend-series-item {
  color: var(--series-color, color-mix(in oklab, var(--ds-text) 74%, var(--ds-muted)));
  font-weight: 700;
}

#salesTrendMeta .trend-series-item b {
  color: inherit;
}

.logo-a {
  color: var(--ds-text);
  text-shadow: 0 1px 8px color-mix(in oklab, var(--ds-text) 40%, transparent);
}

.logo-b {
  color: var(--ds-accent);
  background: linear-gradient(102deg, var(--ds-accent), var(--ds-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 0.45px color-mix(in oklab, var(--ds-text) 24%, transparent);
}

.pitch-grid article {
  border-color: var(--ds-border);
  background: color-mix(in oklab, var(--ds-surface-soft) 90%, #ffffff);
}

.pitch-grid h4 {
  color: var(--ds-text);
}

.pitch-grid ul,
.pitch-grid ol,
.pitch-note {
  color: color-mix(in oklab, var(--ds-text) 78%, var(--ds-muted));
}

.auth-main-box .btn-secondary {
  color: var(--ds-text);
  border-color: var(--ds-border-strong);
  background: color-mix(in oklab, var(--ds-surface-soft) 92%, #ffffff);
}

.auth-main-box .btn-secondary:hover {
  background: color-mix(in oklab, var(--ds-surface-soft) 78%, #ffffff);
}

#adminAppearanceSummaryTable td:first-child {
  color: color-mix(in oklab, var(--ds-text) 72%, var(--ds-muted));
}

#adminAppearanceSummaryTable td:last-child {
  color: var(--ds-text);
  font-weight: 700;
}

#adminAppearanceModal .team-modal-card {
  width: min(960px, 96vw);
}

#adminAppearanceModal .theme-picks {
  max-height: 360px;
  overflow: auto;
}

#adminAppearanceModal .check,
#adminAppearanceModal label,
#adminAppearanceModal .hint {
  color: var(--ds-text);
}

.icon-bell-btn {
  position: relative;
  min-width: 46px;
  padding: 8px 10px;
}

.icon-bell-btn .bell-emoji {
  font-size: 18px;
  line-height: 1;
}

.icon-bell-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff5f7f;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
}

.mobile-drawer-controls {
  display: none;
  gap: 10px;
  padding: 10px;
  border: 1px solid color-mix(in oklab, var(--line) 84%, #ffffff);
  border-radius: 14px;
  background: color-mix(in oklab, var(--panel-bg) 90%, #ffffff);
}

.mobile-drawer-topline {
  display: grid;
  grid-template-columns: 46px minmax(72px, 0.95fr) minmax(120px, 1fr);
  gap: 8px;
  align-items: center;
}

.mobile-drawer-profile-btn {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
}

.mobile-drawer-profile-btn .topbar-avatar-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-drawer-quick-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}

.mobile-drawer-quick-nav {
  width: 100%;
}

.mobile-drawer-quick-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.mobile-drawer-nav-item {
  width: 100%;
  justify-content: flex-start;
  min-height: 44px;
}

.social-toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.social-toast {
  width: min(340px, calc(100vw - 36px));
  background: #0f1731;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 24px rgba(5, 10, 30, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  color: #f3f7ff;
  opacity: 0;
  transform: translateY(-8px);
  transition: all .2s ease;
}

.social-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.social-toast strong {
  color: #ffffff;
}

.social-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.social-game-card {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-bg) 86%, var(--accent) 14%);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.social-game-card:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line) 40%);
}

.social-game-icon {
  font-size: 28px;
}

.social-game-title {
  font-weight: 700;
  font-size: 16px;
}

.social-modal-card {
  max-width: 840px;
}

.social-avatar-editor {
  display: grid;
  gap: 12px;
}

.social-game-wrap canvas {
  width: min(100%, 420px);
  max-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
  margin: 10px auto 8px;
  background: #0f1731;
  touch-action: none;
}

.social-game-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.social-game-controls button {
  min-width: 70px;
  min-height: 40px;
  font-weight: 700;
}

.social-game-menu {
  display: grid;
  gap: 14px;
}

.social-game-record {
  font-size: 15px;
}

.social-me-row td {
  color: var(--accent-strong);
  font-weight: 700;
}

.social-chat-layout {
  display: grid;
  grid-template-columns: minmax(240px, 330px) 1fr;
  gap: 0;
  min-height: 560px;
  height: clamp(560px, 72vh, 820px);
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel-bg-soft);
}

.social-chat-sidebar {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in oklab, var(--panel-bg) 72%, #ffffff);
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 0;
}

.social-chat-sidebar-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.social-chat-sidebar-head h3 {
  margin: 0;
}

.social-chat-head-buttons {
  display: inline-flex;
  gap: 6px;
}

.social-chat-search {
  padding: 8px 14px 12px;
  border-bottom: 1px solid var(--line);
}

.social-chat-search input {
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel-bg);
  color: var(--text);
}

.social-chat-threads {
  overflow: auto;
  padding: 4px 0;
  display: grid;
  gap: 0;
}

.social-thread-item {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 10px 14px;
  text-align: left;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  transition: background 0.15s ease;
  color: inherit;
}

.social-thread-item.active {
  background: color-mix(in oklab, var(--accent) 18%, transparent);
}

.social-thread-item:hover {
  background: color-mix(in oklab, var(--accent) 12%, transparent);
}

.social-thread-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-thread-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.social-thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.social-thread-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-thread-unread {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ff5f7f;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  margin-left: auto;
}

.social-thread-preview {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-thread-time {
  color: var(--text-muted);
  font-size: 11px;
  flex: none;
}

.social-chat-main {
  border: 0;
  border-radius: 0;
  background: var(--panel-bg);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
}

.social-chat-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  background: color-mix(in oklab, var(--panel-bg) 85%, #ffffff);
  font-weight: 700;
}

.social-chat-back {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--panel-bg) 88%, #ffffff);
  color: var(--text);
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.social-chat-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.social-chat-head-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.social-chat-head-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.social-chat-head-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-chat-head-title.is-clickable,
.social-chat-head-subtitle.is-clickable {
  cursor: pointer;
}

.social-chat-head-title.is-clickable:hover,
.social-chat-head-subtitle.is-clickable:hover {
  color: color-mix(in oklab, var(--accent) 66%, var(--text));
}

.social-chat-head-subtitle {
  font-size: 12px;
}

.social-chat-head-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
  flex: 0 0 auto;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-chat-head-meta.online-now {
  color: color-mix(in oklab, #16c784 74%, var(--text));
  font-weight: 700;
}

.social-chat-head-actions {
  display: flex;
  gap: 8px;
}

.social-chat-messages {
  padding: 18px 18px 12px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(circle at 15% 5%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 42%),
    radial-gradient(circle at 85% 0%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 42%),
    color-mix(in oklab, var(--panel-bg) 92%, #ffffff);
}

.social-chat-loading {
  margin: auto;
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: color-mix(in oklab, var(--panel-bg) 84%, #ffffff);
}

.social-chat-load {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.social-chat-loadmore {
  width: auto;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
}

.tg-date-sep {
  align-self: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--panel-bg) 80%, #ffffff);
  border: 1px solid var(--line);
}

.tg-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 86%;
  --tg-user-accent: var(--accent);
}

.tg-msg-row.mine {
  margin-left: auto;
  justify-content: flex-end;
}

.tg-msg-row.compact {
  margin-top: -2px;
}

.tg-msg-avatar {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
}

.tg-msg-avatar.placeholder {
  visibility: hidden;
}

.tg-msg-bubble {
  position: relative;
  border-radius: 14px;
  padding: 8px 10px 6px;
  background: var(--panel-bg);
  border: 1px solid color-mix(in oklab, var(--line) 80%, transparent);
  border-left: 3px solid color-mix(in oklab, var(--tg-user-accent) 70%, transparent);
  box-shadow: 0 6px 14px rgba(6, 12, 24, 0.12);
}

.tg-msg-row.mine .tg-msg-bubble {
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--tg-user-accent) 28%, var(--panel-bg) 72%),
    color-mix(in oklab, var(--tg-user-accent) 18%, var(--panel-bg) 82%));
  border-left-color: color-mix(in oklab, var(--line) 70%, transparent);
  border-right: 3px solid color-mix(in oklab, var(--tg-user-accent) 70%, transparent);
  box-shadow: 0 8px 18px rgba(6, 12, 24, 0.18);
}

.tg-msg-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--tg-user-accent);
  margin-bottom: 2px;
}

.social-participant-list {
  display: grid;
  gap: 8px;
}

.social-participant-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklab, var(--panel-bg) 90%, #ffffff);
  padding: 8px 10px;
}

.social-participant-avatar {
  display: grid;
  place-items: center;
}

.social-participant-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.social-participant-main b {
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-participant-main small {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-participant-open {
  font-size: 18px;
  color: var(--text-muted);
}

.social-profile-view {
  display: grid;
  gap: 12px;
}

.social-profile-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.social-profile-head-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.social-profile-head-text h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.social-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.social-profile-grid > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in oklab, var(--panel-bg) 88%, #ffffff);
  padding: 8px 10px;
  display: grid;
  gap: 3px;
}

.social-profile-grid > div > span {
  font-size: 11px;
  color: var(--text-muted);
}

.social-profile-grid > div > b {
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tg-msg-text {
  white-space: pre-wrap;
  line-height: 1.35;
}

.tg-msg-reply {
  border-left: 3px solid color-mix(in oklab, var(--tg-user-accent) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in oklab, var(--panel-bg) 82%, #ffffff);
  padding: 5px 8px;
  margin-bottom: 6px;
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.tg-msg-reply b {
  font-size: 11px;
  color: var(--tg-user-accent);
  line-height: 1.2;
}

.tg-msg-reply span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-msg-attachments {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.tg-attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid color-mix(in oklab, var(--line) 82%, transparent);
  border-radius: 10px;
  padding: 5px 8px;
  background: color-mix(in oklab, var(--panel-bg) 86%, #ffffff);
}

.tg-attach:hover {
  border-color: color-mix(in oklab, var(--accent) 52%, var(--line));
}

.tg-attach-image {
  padding: 4px;
  max-width: min(260px, 60vw);
  overflow: hidden;
}

.tg-attach-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.tg-msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tg-reaction {
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--line) 86%, transparent);
  background: color-mix(in oklab, var(--panel-bg) 84%, #ffffff);
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}

.tg-reaction.active {
  border-color: color-mix(in oklab, var(--accent) 58%, var(--line));
  background: color-mix(in oklab, var(--accent) 18%, var(--panel-bg));
}

.tg-msg-time {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

.tg-msg-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.tg-msg-status-dot.sending {
  background: #f5c14b;
}

.tg-msg-status-dot.failed {
  background: #e05252;
}

.tg-msg-status-dot.sent {
  background: #4d8cff;
}

.tg-msg-status-dot.read {
  background: #24b47e;
}

.tg-msg-row.mine .tg-msg-time {
  color: color-mix(in oklab, var(--tg-user-accent) 55%, var(--text-muted));
}

.social-chat-compose {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  background: color-mix(in oklab, var(--panel-bg) 88%, #ffffff);
}

.social-chat-reply {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid color-mix(in oklab, var(--line) 84%, transparent);
  border-radius: 12px;
  padding: 8px 10px;
  background: color-mix(in oklab, var(--panel-bg) 84%, #ffffff);
}

.social-chat-reply-content {
  display: grid;
  min-width: 0;
}

.social-chat-reply-content small {
  color: var(--text-muted);
  font-size: 11px;
}

.social-chat-reply-content b {
  font-size: 13px;
}

.social-chat-reply-content span {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-chat-input-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: end;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 8px;
}

.social-chat-compose textarea {
  resize: none;
  min-height: 42px;
  max-height: 120px;
  border: 0;
  padding: 6px 2px;
  background: transparent;
}

.social-emoji-btn {
  min-width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  border-radius: 12px;
}

.social-attach-btn {
  min-width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 17px;
  border-radius: 12px;
}

.social-chat-send {
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 700;
}

.social-chat-context {
  position: fixed;
  z-index: 2200;
  min-width: 188px;
  max-width: min(320px, calc(100vw - 20px));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(9, 19, 46, 0.25);
  background: color-mix(in oklab, var(--panel-bg) 92%, #ffffff);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.social-chat-context.hidden {
  display: none;
}

.social-chat-context-btn {
  width: 100%;
  text-align: left;
}

.social-chat-context-reactions {
  display: grid;
  grid-template-columns: repeat(6, minmax(28px, 1fr));
  gap: 6px;
}

.social-chat-context-emoji {
  min-width: 28px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.tg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--panel-bg) 55%, var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  overflow: hidden;
}

.tg-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.14s linear;
}

.tg-avatar .tg-avatar-fallback {
  display: inline;
}

.tg-avatar.has-image .tg-avatar-fallback {
  display: none;
}

.tg-avatar.has-image.is-pending img {
  opacity: 0;
}

.tg-avatar.has-image.is-pending .tg-avatar-fallback {
  display: inline;
}

.tg-avatar-xs {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.tg-avatar-sm {
  width: 38px;
  height: 38px;
  font-size: 12px;
}

.tg-avatar-md {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.social-direct-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
}

.social-direct-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-direct-info {
  display: grid;
  gap: 2px;
  text-align: left;
}

.social-emoji-picker {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  border: 1px solid var(--ds-border);
  border-radius: 12px;
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow);
  padding: 8px;
  display: grid;
  gap: 8px;
  z-index: 30;
}

.social-emoji-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.social-emoji-tab {
  border: 1px solid var(--ds-border);
  border-radius: 999px;
  background: var(--ds-surface-soft);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.social-emoji-tab.active {
  border-color: color-mix(in oklab, var(--ds-accent) 60%, var(--ds-border));
  background: color-mix(in oklab, var(--ds-surface-soft) 80%, #ffffff);
  color: var(--ds-text);
}

.social-emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(28px, 1fr));
  gap: 6px;
}

.social-emoji-item {
  border: 1px solid var(--ds-border);
  border-radius: 8px;
  background: var(--ds-surface-soft);
  cursor: pointer;
  height: 30px;
  font-size: 18px;
  display: grid;
  place-items: center;
}

.social-emoji-item:hover {
  border-color: color-mix(in oklab, var(--ds-accent) 60%, var(--ds-border));
  background: color-mix(in oklab, var(--ds-surface-soft) 86%, #ffffff);
}


.social-direct-list {
  max-height: 380px;
  overflow: auto;
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.social-group-editor {
  display: grid;
  gap: 12px;
}

.social-group-editor > label {
  display: grid;
  gap: 6px;
}

.social-group-members {
  display: grid;
  gap: 8px;
}

.social-group-members-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 10px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: color-mix(in oklab, var(--panel-bg) 86%, #ffffff);
}

.social-direct-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-bg-soft);
  text-align: left;
  padding: 10px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
}

.social-task-toolbar {
  display: grid;
  grid-template-columns: auto auto 1fr 1fr;
  gap: 10px;
}

.social-tasks-board {
  margin-top: 12px;
  max-height: 520px;
  overflow: auto;
}

.social-task-list {
  display: grid;
  gap: 10px;
}

.social-task-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-bg-soft);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.social-task-row.is-assignee {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-bg-soft) 90%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.social-task-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-strong);
}

.social-task-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.social-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.social-task-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.social-status {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--panel-bg) 40%, var(--line) 60%);
}

.social-status.todo {
  background: color-mix(in srgb, #5eead4 24%, var(--panel-bg) 76%);
}

.social-status.in_progress {
  background: color-mix(in srgb, #60a5fa 24%, var(--panel-bg) 76%);
}

.social-status.done {
  background: color-mix(in srgb, #34d399 24%, var(--panel-bg) 76%);
}

.social-priority {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--panel-bg) 40%, var(--line) 60%);
}

.social-priority.high,
.social-priority.critical {
  background: color-mix(in srgb, #ff5f7f 42%, var(--panel-bg) 58%);
  color: #fff;
}

.social-task-comments {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.social-task-comment {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 8px;
  background: var(--panel-bg-soft);
}

.social-task-comment small {
  margin-left: 8px;
  color: var(--text-muted);
}

.social-calendar-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.social-calendar-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.social-calendar-grid {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-bg-soft);
  overflow: hidden;
}

.social-calendar-row.head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
}

.social-calendar-row.head span {
  padding: 8px 6px;
  text-align: center;
  color: var(--text-muted);
}

.social-calendar-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.social-day {
  min-height: 86px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-bg);
  text-align: left;
  padding: 8px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  align-content: stretch;
}
.social-day b {
  position: relative;
}

.social-day.active {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.social-day.today {
  outline: 2px solid color-mix(in oklab, var(--ds-accent) 70%, var(--ds-border));
  outline-offset: -2px;
  background:
    radial-gradient(circle at 78% 22%, color-mix(in oklab, var(--ds-accent) 35%, transparent), transparent 45%),
    color-mix(in oklab, var(--ds-surface-soft) 78%, var(--ds-accent));
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--ds-accent) 55%, transparent);
}

.social-day.today b {
  color: var(--ds-text);
}

.social-day.today b::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ds-accent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ds-surface) 80%, transparent);
}

.social-day.has-event b {
  color: var(--accent);
  position: relative;
  padding-right: 10px;
}

.social-day.has-event b::after {
  content: "•";
  position: absolute;
  right: 0;
  top: -2px;
  color: #ff6f91;
}

.social-day.has-task b::before {
  content: "•";
  position: absolute;
  right: 8px;
  top: -2px;
  color: #5eead4;
}

.social-day.muted {
  opacity: .32;
}

.social-day small {
  color: var(--text-muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.calendar-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.calendar-sep {
  opacity: 0.6;
}

.calendar-tasks.my-task {
  font-weight: 700;
  color: color-mix(in oklab, #1dd690 70%, var(--text));
}

.social-day.has-my-task {
  box-shadow: inset 0 0 0 2px color-mix(in oklab, #1dd690 28%, transparent);
}

.social-day.my-task-many {
  background:
    linear-gradient(180deg, color-mix(in oklab, #1dd690 12%, var(--panel-bg)), var(--panel-bg));
}

.social-calendar-events {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.social-day-events h5 {
  margin: 0 0 8px;
}

.social-day-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: var(--panel-bg-soft);
  margin-bottom: 8px;
}

.social-calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
  width: 100%;
  max-width: none;
  margin-right: 0;
}

.social-calc-grid section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel-bg-soft);
  display: grid;
  gap: 12px;
  min-height: 260px;
}

.social-calc-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.social-calc-shell,
.social-conv-shell,
.social-volume-shell,
.social-calc-placeholder {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel-bg-soft);
  display: grid;
  gap: 12px;
}

.social-calc-placeholder {
  background: color-mix(in oklab, var(--panel-bg-soft) 75%, var(--panel-bg));
  border-style: dashed;
  color: var(--text-muted);
}

.social-calc-display {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--panel-bg) 82%, var(--panel-bg-soft));
  border: 1px solid var(--line);
}

.social-calc-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.social-calc-input {
  font-size: 16px;
  font-weight: 600;
  text-align: right;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 4px 0;
}

.social-calc-input::placeholder {
  color: color-mix(in oklab, var(--text) 55%, transparent);
}

.social-calc-back {
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
}

.social-calc-result {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  text-align: right;
  color: var(--text);
  letter-spacing: 0.01em;
}

.social-calc-pad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.social-calc-pad button {
  border-radius: 14px;
  padding: 12px 0;
  font-weight: 700;
  font-size: 16px;
  background: color-mix(in oklab, var(--panel-bg) 80%, #ffffff);
  color: var(--text);
  border: 1px solid color-mix(in oklab, var(--line) 80%, #ffffff);
  box-shadow: 0 2px 8px rgba(10, 24, 52, 0.06);
  text-shadow: none;
}

#socialSubtabCalculator .social-calc-pad button {
  color: #0b1f3b;
}

.social-calc-eq {
  background: linear-gradient(130deg, #18c08f, #12b98a);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(18, 185, 138, 0.32);
}

.calc-op {
  background: linear-gradient(130deg, color-mix(in oklab, var(--accent) 65%, #ffffff), var(--accent));
  color: #ffffff;
  border-color: color-mix(in oklab, var(--accent) 70%, var(--line));
}

.calc-fn {
  background: #e7efff;
  color: #0b1f3b;
  border-color: rgba(78, 108, 150, 0.4);
}

body[data-theme="light"] .social-calc-pad button {
  background: #f8f9fc;
  color: #0c2240;
  border-color: rgba(95, 116, 140, 0.24);
  box-shadow: 0 2px 6px rgba(28, 59, 98, 0.06);
  text-shadow: none;
}
body[data-theme="light"] .calc-op {
  background: linear-gradient(130deg, #3b82f6, #2563eb);
  color: #ffffff;
  border-color: rgba(45, 107, 255, 0.6);
}
body[data-theme="light"] .calc-fn {
  background: #e9f0ff;
  color: #0c2240;
  border-color: rgba(77, 109, 171, 0.3);
}
body[data-theme="light"] .social-calc-eq {
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(18, 185, 138, 0.25);
}

.calc-zero {
  grid-column: span 2;
  text-align: center;
  padding-left: 0;
}

.conv-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 0;
}

.social-notes-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 12px;
}

.social-notes-sidebar {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--panel-bg-soft);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-height: 520px;
}

.profile-avatar-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: start;
}
.profile-avatar-preview {
  width: 110px;
  height: 110px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--panel-bg) 75%, var(--line));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
}
.profile-avatar-controls {
  display: grid;
  gap: 10px;
}
.profile-avatar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 8px;
}
.avatar-chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  background: color-mix(in oklab, var(--panel-bg) 88%, var(--line));
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.avatar-chip img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}
.avatar-chip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 45%, transparent);
  transform: translateY(-1px);
}
.team-avatar-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: center;
}
.team-avatar-controls {
  display: grid;
  gap: 8px;
}

.social-notes-list {
  overflow: auto;
  display: grid;
  gap: 8px;
}

.social-note-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-bg);
  padding: 8px;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.social-note-row.active {
  border-color: var(--accent);
}

.social-note-main {
  border: 0;
  background: transparent;
  text-align: left;
  display: grid;
  gap: 4px;
  width: 100%;
  color: inherit;
}

.social-note-delete {
  padding: 6px 8px;
}

.social-notes-editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel-bg-soft);
  display: grid;
  gap: 10px;
}

.social-note-files-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#socialNoteFileUpload {
  display: none;
}

.social-note-files {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 8px;
  background: var(--panel-bg);
  min-height: 56px;
}

.social-note-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 8px;
}

.social-note-file-row a {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-note-file-row button {
  padding: 4px 8px;
  line-height: 1;
}

#returnsRaw:empty {
  display: none;
}

@media (max-width: 1024px) {
  .social-chat-layout,
  .social-notes-layout {
    grid-template-columns: 1fr;
  }

  .social-chat-head {
    flex-wrap: wrap;
  }

  .social-chat-head-meta {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .social-chat-layout {
    height: auto;
    min-height: 0;
  }

  .social-chat-layout .social-chat-main {
    display: none;
  }

  .social-chat-layout.chat-open .social-chat-main {
    display: grid;
  }

  .social-chat-layout.chat-open .social-chat-sidebar {
    display: none;
  }

  .social-chat-back {
    display: inline-flex;
  }

  .social-tasks-board {
    max-height: none;
  }

  .social-task-row {
    grid-template-columns: 1fr;
  }

  .social-calc-grid {
    grid-template-columns: 1fr;
  }

  .social-calc-side {
    grid-template-columns: 1fr;
  }

  .social-calendar-events {
    grid-template-columns: 1fr;
  }

  .social-game-wrap canvas {
    width: min(100%, 360px);
    margin: 8px auto 6px;
  }

  .social-game-controls {
    gap: 6px;
  }

  .social-game-controls button {
    min-width: 62px;
    min-height: 42px;
    font-size: 18px;
    border-radius: 10px;
    padding: 8px 10px;
  }
}

@media (max-width: 900px) {
  .mobile-nav-toggle { display: inline-flex; }
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0 10px 22px;
    margin: 0 auto;
  }
  #appSection.app-shell {
    margin: 0 auto;
    padding-top: 0;
  }
  .profile-avatar-grid {
    grid-template-columns: 1fr;
  }
  .profile-avatar-preview {
    width: 96px;
    height: 96px;
  }
  .team-avatar-row {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 12px;
    left: 12px;
    bottom: 12px;
    height: auto;
    width: min(92vw, 360px);
    max-width: 100%;
    transform: translateX(-110%);
    z-index: 1200;
    box-shadow: 0 20px 50px rgba(6, 10, 28, 0.45);
    overflow-y: auto;
  }
  .app-shell.nav-open .sidebar {
    transform: translateX(0);
  }
  .app-shell.nav-open .mobile-nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  #mainSidebar .sidebar-toggle {
    display: none;
  }
  .workspace {
    min-width: 0;
    min-height: auto;
  }
  #appSection .workspace {
    min-height: auto;
  }
  table {
    min-width: 720px;
  }
  .table-card {
    overflow-x: auto;
  }
  .panel {
    padding: 12px;
  }
  .topbar h1 {
    font-size: 22px;
  }
  .topbar p {
    font-size: 13px;
  }
}

/* 2026-03 contrast hardening v3 */
:root {
  --text-muted: var(--ds-muted);
}

body[data-theme] {
  --text: var(--ds-text);
  --muted: var(--ds-muted);
  --line: var(--ds-border);
  --panel: var(--ds-surface);
  --panel-2: var(--ds-surface-2);
  --surface-0: var(--ds-surface);
  --surface-1: var(--ds-surface);
  --surface-2: var(--ds-surface-2);
  --surface-soft: var(--ds-surface-soft);
  --surface-border: var(--ds-border);
  --surface-border-strong: var(--ds-border-strong);
  --surface-shadow: var(--ds-shadow);
  --bg-1: var(--ds-bg);
  --bg-2: var(--ds-bg-2);
  --field-bg: var(--ds-surface);
  --field-placeholder: color-mix(in oklab, var(--ds-muted) 70%, var(--ds-text));
  --accent: var(--ds-accent);
  --neon: var(--ds-accent-2);
  --ok: var(--ds-ok);
  --danger: var(--ds-danger);
}

#adminPanelSection {
  --admin-strong-text: var(--ds-text);
}

#adminPanelSection .workspace .panel,
#adminPanelSection .workspace .table-card {
  background: var(--ds-surface);
  border-color: var(--ds-border);
  color: var(--ds-text);
}

#adminPanelSection .table-card table,
#adminPanelSection .table-card th,
#adminPanelSection .table-card td,
#adminPanelSection .table-card tr,
#adminPanelSection .panel h1,
#adminPanelSection .panel h2,
#adminPanelSection .panel h3,
#adminPanelSection .panel h4,
#adminPanelSection .table-card h1,
#adminPanelSection .table-card h2,
#adminPanelSection .table-card h3,
#adminPanelSection .table-card h4,
#adminPanelSection .admin-team-card-grid label,
#adminPanelSection .admin-user-field,
#adminPanelSection .admin-user-profile-head,
#adminPanelSection .admin-ai-item .ai-title {
  color: var(--ds-text);
}

#adminPanelSection .hint,
#adminPanelSection .admin-user-field span,
#adminPanelSection .admin-team-card-grid label > span {
  color: var(--ds-muted);
}

#adminPanelSection table th {
  background: var(--ds-surface-soft);
  color: var(--ds-text);
}

.topbar-popover {
  background: var(--ds-surface);
  border-color: var(--ds-border);
  color: var(--ds-text);
  box-shadow: var(--ds-shadow);
}

.topbar-popover * {
  color: inherit;
}

.topbar-popover small {
  color: var(--ds-muted);
}

.topbar-popover .avatar {
  background: color-mix(in oklab, var(--ds-accent) 18%, var(--ds-surface-soft));
  color: var(--ds-text);
}

.team-modal-card,
.admin-user-profile-card {
  background: var(--ds-surface);
  border-color: var(--ds-border);
  color: var(--ds-text);
}

.team-modal-card .hint,
.team-modal-card small,
.team-modal-card label > span,
.team-modal-card .team-modal-access > span,
.admin-user-profile-card .hint,
.admin-user-profile-card small {
  color: color-mix(in oklab, var(--ds-text) 72%, var(--ds-muted));
}

#help .help-header-title p,
#help .help-card-head small,
#help .help-block p,
#help .help-block li,
#help .help-card-body {
  color: color-mix(in oklab, var(--ds-text) 78%, var(--ds-muted));
}

#adminPanelSection .panel,
#adminPanelSection .table-card,
#adminPanelSection .admin-tab {
  color: var(--ds-text);
}

#adminPanelSection .hint {
  color: color-mix(in oklab, var(--ds-text) 72%, var(--ds-muted));
}

body[data-theme="light"] .sidebar .brand p,
body[data-theme="light"] .sidebar .nav-label,
body[data-theme="light"] .sidebar .nav-icon {
  color: var(--ds-text);
}

body[data-theme="light"] .nav-btn {
  color: var(--ds-text);
  border-color: var(--ds-border);
  background: var(--ds-surface-soft);
}

body[data-theme="light"] .nav-btn:hover {
  background: color-mix(in oklab, var(--ds-surface-soft) 82%, #ffffff);
}

/* 2026-03 modern refresh v4: unified user/admin style + mobile spacing fix */
:root {
  --ui-card-radius: 18px;
  --ui-card-shadow: 0 14px 34px rgba(18, 36, 73, 0.15);
  --ui-soft-shadow: 0 8px 20px rgba(18, 36, 73, 0.1);
}

body[data-theme] {
  background:
    radial-gradient(90% 75% at 5% -10%, color-mix(in oklab, var(--ds-accent) 22%, transparent), transparent 62%),
    radial-gradient(80% 70% at 110% -5%, color-mix(in oklab, var(--ds-accent-2) 20%, transparent), transparent 64%),
    linear-gradient(145deg, var(--ds-bg), color-mix(in oklab, var(--ds-bg) 72%, #eaf2ff));
}

.app-bg {
  opacity: 0.36;
  mask-image: radial-gradient(circle at center, black 62%, transparent 100%);
}

.app-shell {
  margin: 10px auto;
  padding-bottom: 18px;
}

.sidebar {
  border-radius: 22px;
  border: 1px solid color-mix(in oklab, var(--ds-border) 85%, #ffffff);
  box-shadow: var(--ui-card-shadow);
  backdrop-filter: blur(8px);
}

.nav-btn {
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--ds-border) 82%, #ffffff);
  background: color-mix(in oklab, var(--ds-surface) 92%, #ffffff);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--ui-soft-shadow);
}

.nav-btn.active {
  border-color: color-mix(in oklab, var(--ds-accent) 56%, var(--ds-border));
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--ds-accent) 22%, var(--ds-surface)),
    color-mix(in oklab, var(--ds-accent-2) 20%, var(--ds-surface))
  );
}

.workspace {
  border-radius: 22px;
  border: 1px solid color-mix(in oklab, var(--ds-border) 80%, #ffffff);
  box-shadow: var(--ui-card-shadow);
}

.topbar {
  border-radius: var(--ui-card-radius);
  box-shadow: var(--ui-soft-shadow);
}

.topbar-avatar-btn {
  border-radius: 999px;
}

.topbar-popover {
  border-radius: 16px;
}

.topbar-popover .avatar {
  border-radius: 50%;
}

.panel,
.table-card,
.help-card,
.campaign-modal-card,
.team-modal-card,
.admin-user-profile-card {
  border-radius: var(--ui-card-radius);
  box-shadow: var(--ui-soft-shadow);
}

.chip-btn,
.chip-select,
button,
.btn-secondary,
.btn-danger {
  border-radius: 12px;
}

.kpi {
  border-radius: 14px;
  box-shadow: var(--ui-soft-shadow);
}

.social-chat-layout,
.social-note-row,
.social-notes-editor,
.social-task-col {
  border-radius: 16px;
}

.profile-avatar-preview {
  border-radius: 50%;
  width: 116px;
  height: 116px;
  overflow: hidden;
}

.profile-avatar-preview img {
  border-radius: 50%;
}

#adminPanelSection .admin-nav {
  font-weight: 700;
}

#adminPanelSection .panel,
#adminPanelSection .table-card {
  background: color-mix(in oklab, var(--ds-surface) 94%, #ffffff);
}

@media (max-width: 900px) {
  .app-shell {
    margin: 0 auto !important;
    padding-top: 0 !important;
  }

  #appSection.app-shell {
    margin: 0 auto !important;
    padding: 0 8px 14px !important;
  }

  #appSection .workspace {
    margin-top: 0 !important;
    padding-top: 0 !important;
    min-height: auto !important;
  }

  #appSection .topbar {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
  }

  #appSection .tab:not(.hidden) {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  .social-chat-layout {
    min-height: 0 !important;
    height: auto !important;
  }
}

@media (max-width: 980px) {
  #appSection.app-shell {
    display: block !important;
    margin: 0 !important;
    padding: 0 8px 12px !important;
    max-width: 100% !important;
  }

  #appSection > .workspace {
    margin: 0 !important;
    padding: 8px !important;
    min-height: 0 !important;
  }

  #appSection > .workspace > .topbar {
    position: static !important;
    top: auto !important;
    margin-top: 0 !important;
  }

  #appSection > .workspace > .tab:not(.hidden) {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}

/* 2026-03 auth polish: reliable layout + readable contrast on all themes */
#authSection.auth-wrap {
  padding: 14px 12px 18px;
}

#authSection .landing-wrap {
  max-width: min(1460px, calc(100vw - 12px));
  margin: 0 auto;
}

#authSection .auth-toolbar {
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--ds-border) 82%, #ffffff);
  background: linear-gradient(155deg, color-mix(in oklab, var(--ds-surface) 95%, #ffffff), var(--ds-surface));
  box-shadow: 0 10px 26px rgba(15, 34, 72, 0.12);
}

#authSection .auth-toolbar-nav a {
  color: color-mix(in oklab, var(--ds-text) 84%, var(--ds-muted));
}

#authSection .auth-toolbar-nav a:hover {
  color: var(--ds-text);
}

#authSection .auth-card.auth-hero {
  border-radius: 22px;
  border: 1px solid color-mix(in oklab, var(--ds-border) 84%, #ffffff);
  background:
    radial-gradient(95% 85% at 94% -8%, color-mix(in oklab, var(--ds-accent-2) 16%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in oklab, var(--ds-surface) 95%, #ffffff), color-mix(in oklab, var(--ds-surface-2) 92%, #ffffff));
  box-shadow: 0 16px 36px rgba(16, 35, 70, 0.14);
}

#authSection .auth-grid.single {
  width: 100%;
}

#authSection .auth-main-box {
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--ds-border) 85%, #ffffff);
  background: color-mix(in oklab, var(--ds-surface) 94%, #ffffff);
  box-shadow: 0 12px 24px rgba(21, 42, 81, 0.1);
}

#authSection .auth-main-box input {
  height: 46px;
  border-radius: 12px;
  background: color-mix(in oklab, #ffffff 88%, var(--ds-surface-soft));
  border: 1px solid color-mix(in oklab, var(--ds-border-strong) 88%, #ffffff);
  color: var(--ds-text);
}

#authSection .auth-main-box input::placeholder {
  color: color-mix(in oklab, var(--ds-muted) 78%, var(--ds-text));
}

#authSection .auth-main-box .remember-row {
  color: color-mix(in oklab, var(--ds-text) 86%, var(--ds-muted));
}

#authSection .auth-main-box button {
  min-height: 44px;
}

#authSection .auth-proof > div,
#authSection .landing-card,
#authSection .landing-band {
  border: 1px solid color-mix(in oklab, var(--ds-border) 84%, #ffffff);
  background: color-mix(in oklab, var(--ds-surface) 94%, #ffffff);
}

#authSection .landing-card p,
#authSection .landing-band p,
#authSection .pitch-note,
#authSection .auth-toolbar-subtitle {
  color: color-mix(in oklab, var(--ds-text) 80%, var(--ds-muted));
}

#authSection .auth-toolbar-title,
#authSection h1,
#authSection h3,
#authSection h4,
#authSection b,
#authSection strong,
#authSection li {
  color: var(--ds-text);
}

@media (max-width: 980px) {
  #authSection.auth-wrap {
    padding: 10px 8px 14px;
  }

  #authSection .landing-wrap {
    max-width: 100%;
  }

  #authSection .auth-toolbar {
    padding: 10px;
    gap: 10px;
  }

  #authSection .auth-toolbar-nav {
    display: none;
  }

  #authSection .auth-toolbar-controls {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  #authSection .auth-toolbar-controls .chip-select {
    width: 100%;
    min-width: 0;
  }

  #authSection .auth-card.auth-hero {
    padding: 12px;
    border-radius: 16px;
    gap: 12px;
  }

  #authSection .pitch-grid {
    grid-template-columns: 1fr;
  }

  #authSection .auth-main-box {
    padding: 12px;
    border-radius: 14px;
  }

  #authSection .auth-main-box input,
  #authSection .auth-main-box button {
    width: 100%;
  }
}

/* 2026-03 final fixes v5: admin contrast, notification panel layout, mobile top gap */
.admin-sound-upload-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 8px 0 2px;
}

.admin-sound-upload-grid label {
  display: grid;
  gap: 6px;
}

.admin-announcement-actions {
  display: grid;
  gap: 8px;
  align-content: start;
}

#adminAnnouncementBody {
  min-height: 118px;
}

#adminPanelSection .kpi {
  background: linear-gradient(
    145deg,
    color-mix(in oklab, var(--ds-accent) 48%, #0b1430),
    color-mix(in oklab, var(--ds-accent-2) 36%, #132855)
  );
  border-color: color-mix(in oklab, var(--ds-accent-2) 42%, rgba(255, 255, 255, 0.18));
}

#adminPanelSection .kpi-head strong {
  color: #f4fbff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

#adminPanelSection .kpi-head span {
  color: rgba(236, 246, 255, 0.9);
}

#adminPanelSection .kpi-track {
  background: rgba(255, 255, 255, 0.2);
}

#adminPanelSection .kpi-track i {
  background: linear-gradient(90deg, #7cf4ff, #7ea0ff);
}

#adminPanelSection .trend-meta {
  color: color-mix(in oklab, var(--ds-text) 65%, var(--ds-muted));
}

#adminPanelSection .trend-meta b {
  color: var(--ds-text);
}

#adminPanelSection .bar-item .meta {
  color: var(--ds-text);
}

#adminPanelSection .bar-item .meta b {
  color: color-mix(in oklab, var(--ds-text) 88%, var(--ds-accent));
}

#adminPanelSection #adminStatsView {
  background: color-mix(in oklab, var(--ds-surface) 90%, #ffffff);
  color: var(--ds-text);
  border-color: color-mix(in oklab, var(--ds-border) 86%, #ffffff);
}

#adminPanelSection .admin-ai-item {
  background: color-mix(in oklab, var(--ds-surface-2) 92%, #ffffff);
  border-color: color-mix(in oklab, var(--ds-border-strong) 82%, #ffffff);
  color: var(--ds-text);
}

#adminPanelSection .admin-ai-item .ai-title,
#adminPanelSection .admin-ai-item .ai-meta {
  color: var(--ds-text);
}

#adminPanelSection .admin-ai-item .ai-meta {
  opacity: 0.84;
}

#adminPanelSection .admin-ai-item .drag-handle {
  border-color: color-mix(in oklab, var(--ds-border-strong) 85%, #ffffff);
  color: color-mix(in oklab, var(--ds-text) 82%, var(--ds-accent));
}

#adminPanelSection .admin-server-charts .panel {
  background: color-mix(in oklab, var(--ds-surface) 94%, #ffffff);
}

#adminPanelSection .admin-server-charts .trend-chart {
  border: 1px solid color-mix(in oklab, var(--ds-border) 82%, #ffffff);
  border-radius: 10px;
}

#adminPanelSection #adminServerTable td {
  color: var(--ds-text);
}

@media (max-width: 980px) {
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
  }

  #appSection.app-shell,
  #adminPanelSection.app-shell {
    display: block !important;
    margin: 0 !important;
    padding: 0 6px 10px !important;
    max-width: 100% !important;
    gap: 0 !important;
  }

  #appSection > .workspace,
  #adminPanelSection > .workspace {
    margin: 0 !important;
    padding: 8px !important;
    min-height: 0 !important;
    align-content: start !important;
  }

  #appSection > .workspace > .topbar,
  #adminPanelSection > .workspace > .topbar {
    position: static !important;
    top: auto !important;
    margin: 0 0 8px !important;
    transform: none !important;
  }

  #appSection > .workspace > .tab:not(.hidden),
  #adminPanelSection > .workspace > .admin-tab:not(.hidden) {
    margin: 0 !important;
    padding-top: 0 !important;
    align-content: start !important;
  }
}

/* 2026-03 hotfix v6: auth width, admin contrast, mobile clipping */
.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 980px) {
  #appSection > .workspace {
    display: block !important;
  }

  #appSection > .workspace > .tab:not(.hidden) {
    display: block !important;
  }

  #appSection #mainSidebar {
    position: fixed !important;
    top: 10px !important;
    left: 10px !important;
    bottom: 10px !important;
    transform: translateX(-120%) !important;
    visibility: hidden;
    pointer-events: none;
  }

  #appSection.nav-open #mainSidebar {
    transform: translateX(0) !important;
    visibility: visible;
    pointer-events: auto;
  }

  #mainSidebar .sidebar-toggle {
    display: none !important;
  }
}

#authSection .auth-card.auth-hero {
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.9fr);
  align-items: stretch;
}

#authSection .auth-grid.single,
#authSection .auth-main-box {
  width: 100%;
  max-width: none;
  margin: 0;
}

#authSection .auth-main-box .remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
}

#authSection .auth-main-box .remember-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

#appSection > .workspace,
#adminPanelSection > .workspace {
  overflow: visible !important;
}

#appSection .table-card,
#adminPanelSection .table-card {
  overflow-x: auto;
}

#adminPanelSection .panel,
#adminPanelSection .table-card,
#adminPanelSection .admin-tab,
#adminPanelSection .admin-user-profile-card,
#adminPanelSection .team-modal-card {
  color: var(--ds-text);
  border-color: color-mix(in oklab, var(--ds-border) 84%, #ffffff);
}

#adminPanelSection .hint,
#adminPanelSection small,
#adminPanelSection .panel p,
#adminPanelSection .panel li {
  color: color-mix(in oklab, var(--ds-text) 80%, var(--ds-muted));
}

#adminPanelSection input,
#adminPanelSection textarea,
#adminPanelSection select {
  color: var(--ds-text);
  background: color-mix(in oklab, var(--ds-surface) 96%, #ffffff);
  border-color: color-mix(in oklab, var(--ds-border-strong) 80%, #ffffff);
}

#adminPanelSection #adminServerTable td,
#adminPanelSection #adminServerTable th,
#adminPanelSection .admin-ai-item .ai-title,
#adminPanelSection .admin-ai-item .ai-meta,
#adminPanelSection .admin-ai-item .drag-handle,
#adminPanelSection #adminStatsView {
  color: var(--ds-text);
}

@media (max-width: 980px) {
  #authSection .auth-card.auth-hero {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  #authSection .auth-main-box {
    padding: 10px;
  }
}

/* 2026-03 mobile chat/calendar stabilization */
@media (max-width: 980px) {
  #appSection > .workspace > .topbar {
    position: sticky !important;
    top: 6px !important;
    z-index: 220 !important;
  }

  #social > .panel:first-child {
    position: sticky;
    top: 74px;
    z-index: 210;
    background: color-mix(in oklab, var(--ds-surface) 94%, #ffffff);
  }

  #socialSubtabChat .social-chat-layout {
    height: clamp(420px, calc(100dvh - 270px), 760px) !important;
    min-height: 420px !important;
  }

  #socialSubtabChat .social-chat-layout.chat-open .social-chat-main {
    display: grid !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  #socialSubtabChat .social-chat-main {
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
  }

  #socialSubtabChat .social-chat-messages {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #socialSubtabChat .social-chat-compose {
    position: sticky;
    bottom: 0;
    z-index: 6;
  }

  #socialSubtabCalendar .social-calendar-row.head span {
    padding: 6px 2px;
    font-size: 12px;
  }

  #socialSubtabCalendar .social-day {
    min-height: 66px;
    padding: 5px;
    gap: 4px;
  }

  #socialSubtabCalendar .social-day b {
    font-size: 12px;
  }

  #socialSubtabCalendar .social-day small {
    font-size: 10px;
    gap: 4px;
  }

  #socialSubtabCalendar .social-calendar-toolbar {
    gap: 6px;
  }

  #socialSubtabCalendar .social-calendar-nav {
    gap: 4px;
  }

  #socialSubtabCalendar .social-calendar-nav .btn-secondary,
  #socialSubtabCalendar .social-calendar-toolbar > .btn-secondary,
  #socialSubtabCalendar #socialCalendarMonth {
    min-height: 36px;
    padding: 6px 9px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  #socialSubtabCalendar .social-day {
    min-height: 58px;
    padding: 4px;
  }

  #socialSubtabCalendar .social-day small {
    font-size: 9px;
    gap: 3px;
  }
}

/* 2026-03 compact topbar + readable sidebar labels on narrow screens */
@media (max-width: 1200px) and (min-width: 981px) {
  #appSection.app-shell {
    grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
    --sidebar-width: 240px;
  }

  #appSection.app-shell.sidebar-compact {
    grid-template-columns: 82px minmax(0, 1fr);
    --sidebar-width: 82px;
  }

  #appSection #mainSidebar:not(.compact) {
    padding: 12px 10px;
    gap: 10px;
  }

  #appSection #mainSidebar:not(.compact) .brand p,
  #appSection #mainSidebar:not(.compact) .nav-label {
    display: block !important;
  }

  #appSection #mainSidebar:not(.compact) .nav-btn {
    justify-content: flex-start !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  #appSection #mainSidebar:not(.compact) .btn-danger.full {
    padding: 10px 10px;
    font-size: 13px;
  }
}

@media (max-width: 980px) {
  #appSection > .workspace > .topbar {
    padding: 8px 10px;
  }

  #appSection .topbar-controls {
    width: 100% !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    overflow: visible;
    padding-bottom: 2px;
  }

  #appSection .topbar-controls .chip-select,
  #appSection .topbar-controls .chip-btn {
    width: auto !important;
    flex: 0 0 auto;
    min-height: 38px;
    height: 38px;
    border-radius: 10px;
    padding: 0 10px;
  }

  #appSection .topbar-controls #uiLangSelect {
    min-width: 62px;
    max-width: 72px;
  }

  #appSection .topbar-controls #uiThemeSelect {
    min-width: 100px;
    max-width: 126px;
  }

  #appSection .topbar-controls .mobile-nav-toggle,
  #appSection .topbar-controls .icon-bell-btn,
  #appSection .topbar-controls .topbar-avatar-btn {
    width: 40px;
    min-width: 40px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }

  #appSection .topbar-controls .topbar-avatar-btn {
    border-radius: 10px;
  }

  #appSection .topbar-controls .topbar-avatar-btn .topbar-avatar-name {
    display: none;
  }

  #appSection .topbar-controls .topbar-avatar-btn .topbar-avatar {
    width: 30px;
    height: 30px;
  }

  #appSection .topbar-controls .topbar-user-wrap {
    position: static;
  }

  #appSection .topbar-controls .topbar-user-wrap .topbar-popover {
    position: fixed;
    top: 74px;
    right: 10px;
    left: auto;
    width: min(300px, calc(100vw - 20px));
    z-index: 2600;
  }

  /* Products table: keep data readable on narrow screens with horizontal scroll. */
  #products .products-catalog-wrap .table-card {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #products .products-table {
    min-width: 980px !important;
    table-layout: auto;
  }

  #products .products-table th,
  #products .products-table td {
    overflow-wrap: normal;
    word-break: normal;
    white-space: normal;
  }

  #products .products-table th:nth-child(5),
  #products .products-table td:nth-child(5),
  #products .products-table th:nth-child(6),
  #products .products-table td:nth-child(6),
  #products .products-table th:nth-child(7),
  #products .products-table td:nth-child(7) {
    min-width: 180px;
  }

  #products .products-table th:nth-child(9),
  #products .products-table td:nth-child(9) {
    min-width: 92px;
    white-space: nowrap;
  }
}

/* Accounting module */
.accounting-kpis {
  margin-bottom: 12px;
}

.accounting-kpis .sales-kpi strong,
.accounting-market-kpis .sales-kpi strong {
  font-size: 24px;
}

.accounting-kpi-positive strong {
  color: color-mix(in oklab, #17b26a 74%, var(--ds-text));
}

.accounting-kpi-negative strong {
  color: color-mix(in oklab, #e5484d 76%, var(--ds-text));
}

.accounting-kpi-net {
  border-color: color-mix(in oklab, #1da7ff 44%, var(--ds-border)) !important;
  background: linear-gradient(
    145deg,
    color-mix(in oklab, #1da7ff 18%, var(--ds-surface-soft)),
    color-mix(in oklab, #26d0ce 16%, var(--ds-surface-soft))
  ) !important;
}

.accounting-kpi-net strong {
  color: color-mix(in oklab, #0a4aa4 80%, #ffffff);
}

.accounting-kpis .sales-kpi:nth-child(6n + 1),
.accounting-market-kpis .sales-kpi:nth-child(3n + 1) {
  border-color: color-mix(in oklab, var(--accent) 45%, var(--line));
}

.accounting-quick-range {
  margin-top: 10px;
}

.accounting-file-actions {
  margin-top: 10px;
  align-items: center;
  grid-template-columns: minmax(170px, 0.95fr) minmax(180px, 1fr) minmax(160px, 0.9fr) minmax(180px, 1fr) minmax(180px, 1fr);
}

.accounting-file-actions input[type="file"] {
  min-height: 42px;
}

.accounting-settings-grid .field-label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.accounting-settings-grid .field-label > span {
  font-size: 12px;
  color: color-mix(in oklab, var(--fg) 68%, var(--muted));
}

.feedback-prompt-wrap {
  margin-top: 8px;
}

.feedback-prompt-wrap textarea {
  width: 100%;
  min-height: 102px;
}

.accounting-analysis-wrap,
.accounting-expenses-wrap {
  overflow-x: auto;
}

.accounting-table,
.accounting-expenses-table {
  min-width: 1220px;
}

.accounting-table td,
.accounting-expenses-table td {
  vertical-align: top;
}

.accounting-row-loss {
  background: color-mix(in oklab, #ff5b7f 12%, transparent);
}

.accounting-row-profit {
  background: color-mix(in oklab, #20cf9c 9%, transparent);
}

#accountingExpensesTable .row-actions {
  display: inline-flex;
  gap: 6px;
}

#accountingSettingsMeta,
#accountingExpensesMeta,
#accountingAnalysisMeta,
#accountingWarnings {
  margin-top: 8px;
}

@media (max-width: 1180px) {
  .accounting-file-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1200px) and (min-width: 981px) {
  #appSection.app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  #appSection.app-shell:not(.sidebar-compact) {
    --sidebar-width: 240px;
  }

  #appSection #mainSidebar {
    width: 100%;
    min-width: 0;
  }

  #appSection > .workspace {
    min-width: 0;
  }
}

/* Mobile client mode (/mobile): app-like shell with quick module dropdown */
body.mobile-client-mode #appSection.app-shell {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.mobile-client-mode #appSection #mobileNavToggle {
  display: inline-flex !important;
}

body.mobile-client-mode #appSection #mainSidebar {
  position: fixed !important;
  top: 10px !important;
  left: 10px !important;
  bottom: 10px !important;
  width: min(92vw, 360px) !important;
  max-width: calc(100vw - 20px) !important;
  transform: translateX(-112%) !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: 1200 !important;
  overflow-y: auto;
}

body.mobile-client-mode #appSection.nav-open #mainSidebar {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

body.mobile-client-mode #appSection.nav-open .mobile-nav-overlay {
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.mobile-client-mode #appSection #mainSidebar .brand,
body.mobile-client-mode #appSection #mainSidebar .sidebar-toggle,
body.mobile-client-mode #appSection #mainSidebar .side-nav {
  display: none !important;
}

body.mobile-client-mode #mobileDrawerControls {
  display: grid !important;
}

body.mobile-client-mode #appSection .topbar-controls > :not(#mobileNavToggle) {
  display: none !important;
}

body.mobile-client-mode #appSection .topbar-controls {
  width: auto !important;
  margin-left: auto;
}

body.mobile-client-mode #appSection .topbar-title p {
  margin-top: 4px;
  font-size: 13px;
}

body.mobile-client-mode #social > .panel:first-child {
  display: none !important;
}

body.mobile-apk-mode #appSection .topbar {
  background: linear-gradient(125deg, rgba(17, 192, 190, 0.22), rgba(27, 152, 206, 0.2));
  border-color: rgba(49, 201, 198, 0.4);
  padding: 10px 12px;
  min-height: 56px;
}

body.mobile-apk-mode #appSection .topbar-title {
  display: none !important;
}

body.mobile-apk-mode #appSection .topbar-controls {
  width: 100% !important;
  justify-content: space-between;
  align-items: center;
  margin-left: 0 !important;
}

body.mobile-apk-mode #appSection .mobile-quick-nav,
body.mobile-apk-mode #mobileDrawerQuickNavLabel,
body.mobile-apk-mode #mobileDrawerQuickNav {
  display: none !important;
}

body.mobile-apk-mode #appSection .topbar-controls > :not(#mobileNavToggle):not(#mobileChatCompactHead) {
  display: none !important;
}

body.mobile-apk-mode #appSection .topbar-controls #mobileChatCompactHead:not(.hidden) {
  display: inline-flex !important;
}

@media (max-width: 980px) {
  body.mobile-client-mode #appSection > .workspace > .topbar {
    position: sticky !important;
    top: 6px !important;
    z-index: 210 !important;
  }

  body.mobile-client-mode #appSection .topbar h1 {
    font-size: 20px;
  }

  body.mobile-client-mode #socialSubtabChat .social-chat-layout {
    min-height: clamp(440px, calc(100dvh - 220px), 760px) !important;
    height: clamp(440px, calc(100dvh - 220px), 760px) !important;
  }

  body.mobile-apk-mode #socialSubtabChat {
    min-height: calc(100dvh - 108px);
  }

  body.mobile-apk-mode #socialSubtabChat .social-chat-layout {
    min-height: calc(100dvh - 108px) !important;
    height: calc(100dvh - 108px) !important;
    border-radius: 14px;
  }

  body.mobile-apk-mode #socialSubtabChat .social-chat-layout.chat-open .social-chat-main {
    height: 100% !important;
  }

  body.mobile-apk-mode #socialSubtabChat .social-chat-main {
    grid-template-rows: minmax(0, 1fr) auto !important;
  }

  body.mobile-apk-mode #socialSubtabChat .social-chat-head {
    display: none !important;
  }

  body.mobile-apk-mode #socialSubtabChat .social-chat-messages {
    padding: 10px 10px 8px;
  }

  body.mobile-apk-mode #socialSubtabChat .social-chat-compose {
    padding: 8px 10px 10px;
    position: sticky;
    bottom: 0;
    z-index: 8;
  }

  body.mobile-client-mode .social-games-grid {
    grid-template-columns: 1fr;
  }

  body.mobile-client-mode #authSection .auth-shell {
    padding: 16px 12px 20px;
  }

  body.mobile-client-mode #authSection .auth-hero {
    gap: 14px;
  }

  body.mobile-client-mode #authSection .auth-card {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  body.mobile-apk-mode #appSection {
    padding: 0 6px 12px;
  }

  body.mobile-apk-mode #appSection .workspace {
    padding: 8px;
  }
}

@media (max-width: 980px) and (min-width: 720px) {
  #appSection #mainSidebar:not(.compact) .nav-label {
    display: block !important;
  }

  #appSection #mainSidebar:not(.compact) .nav-btn {
    justify-content: flex-start !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

#appSection #mainSidebar:not(.compact) .nav-label {
  display: block !important;
}

#appSection #mainSidebar:not(.compact) .nav-btn {
  justify-content: flex-start !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* 2026-03-08 hotfix: auth mobile overflow + stable hero columns */
#authSection .auth-card.auth-hero {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}

@media (max-width: 1200px) {
  #authSection .auth-card.auth-hero {
    grid-template-columns: 1fr !important;
  }
}

/* 2026-03-08: APK stats layout + chat/profile polish */
body.mobile-apk-mode #sales > .panel:first-of-type {
  display: flex;
  flex-direction: column;
}

body.mobile-apk-mode #sales > .panel:first-of-type #salesTrendChart,
body.mobile-apk-mode #sales > .panel:first-of-type #salesTrendMeta {
  order: 1;
}

body.mobile-apk-mode #sales > .panel:first-of-type #salesTotalsCards,
body.mobile-apk-mode #sales > .panel:first-of-type #salesStatsMeta,
body.mobile-apk-mode #sales > .panel:first-of-type #salesLoadStatus,
body.mobile-apk-mode #sales > .panel:first-of-type #salesExtraWrap {
  order: 2;
}
