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

:root {
  --font-ui: "IBM Plex Sans KR", "Noto Sans KR", sans-serif;
  --bg-page: #eef2f9;
  --bg-card: #ffffff;
  --bg-topbar: #111827;
  --bg-sidebar: #1f2937;
  --line: #d8e0ee;
  --text-main: #10223f;
  --text-subtle: #5e6f8a;
  --accent: #0d6efd;
  --danger: #d33d55;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text-main);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.dashboard-page {
  background: linear-gradient(180deg, #dbe5f7 0%, var(--bg-page) 22%);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  height: 60px;
  padding: 0 18px;
  background: var(--bg-topbar);
  color: #ebf1fd;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar,
.sidebar {
  font-family: var(--font-ui);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark-shell,
.brand-word-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-mark-shell {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  padding: 3px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  border: 1px solid rgba(214, 226, 245, 0.34);
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.35);
}

.brand-word-shell {
  position: relative;
  min-height: 34px;
  padding: 2px 0;
}

.brand-mark {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-wordmark-text {
  display: inline-block;
  color: #f7fbff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  line-height: 1;
  transform: scaleX(1.06);
  text-shadow: 0 2px 10px rgba(100, 180, 255, 0.28);
  user-select: none;
  padding-left: 4px;
}

.brand-word-shell::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 0;
  bottom: 0;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(120, 195, 255, 0.85), rgba(120, 195, 255, 0.15));
}

.login-brand-lockup {
  margin-bottom: 14px;
}

.login-brand-shell {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  padding: 8px;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #c8d7f9;
  font-size: 0.78rem;
  font-weight: 600;
}

.topbar-user {
  color: #f8fbff;
  font-size: 0.9rem;
  font-weight: 500;
}

.topbar-session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 3px 4px 3px 11px;
  border: 1px solid rgba(226, 232, 240, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
}

.topbar-session-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.topbar-session-text strong {
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.topbar-session .badge {
  margin-left: 2px;
  background: #ef4444;
  color: #ffffff;
}

.topbar-session-extend {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1;
}

.notification-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notification-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(226, 232, 240, 0.22);
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fbff;
  cursor: pointer;
}

.notification-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
}

.notification-toggle:hover,
.notification-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(226, 232, 240, 0.38);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(360px, calc(100vw - 28px));
  max-height: 460px;
  overflow: hidden;
  z-index: 1200;
  border: 1px solid #d9e3f3;
  border-radius: 16px;
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.24);
}

.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid #e6edf8;
}

.notification-refresh,
.notification-read-btn {
  border: 1px solid #cad7ee;
  border-radius: 999px;
  background: #f5f8ff;
  color: #24466f;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 5px 9px;
  cursor: pointer;
}

.mk-kpi-card {
  min-height: 160px;
}

.mk-table-scroll {
  overflow-x: auto;
}

.mk-alert-grid {
  margin-top: 10px;
}

.mk-note-list {
  display: grid;
  gap: 12px;
}

.mk-note-item {
  border: 1px solid #d9e3f4;
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.96), rgba(240, 246, 255, 0.92));
  color: #20406e;
  line-height: 1.6;
}

.mk-trend-up-strong {
  background: #eef4ff;
  border-color: #bfd3ff;
  color: #123e8d;
}

.mk-trend-up-soft,
.mk-trend-flat {
  background: #ecfaf3;
  border-color: #a9e2c7;
  color: #0f6a4a;
}

.mk-trend-down-soft {
  background: #fff7ea;
  border-color: #ffdca1;
  color: #8a5000;
}

.mk-trend-down-strong {
  background: #fff0f3;
  border-color: #ffc1cb;
  color: #92243a;
}

.notification-refresh:hover,
.notification-read-btn:hover {
  background: #eaf2ff;
}

.notification-list {
  display: grid;
  gap: 8px;
  max-height: 390px;
  overflow-y: auto;
  padding: 10px;
}

.notification-empty {
  margin: 0;
  padding: 18px 10px;
  color: #64748b;
  text-align: center;
  font-size: 0.9rem;
}

.notification-item {
  position: relative;
  display: grid;
  gap: 5px;
  border: 1px solid #e1e9f6;
  border-radius: 13px;
  padding: 11px 12px;
  background: #f8fbff;
}

.notification-item.unread {
  border-color: #99c2ff;
  background: linear-gradient(180deg, #f4f9ff 0%, #ffffff 100%);
}

.notification-title {
  font-size: 0.9rem;
}

.notification-message {
  margin: 0;
  color: #334155;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.notification-meta {
  margin: 0;
  color: #718096;
  font-size: 0.75rem;
}

.notification-read-btn {
  justify-self: end;
}

.notification-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.notification-delete-btn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.notification-delete-btn:hover {
  background: #ffedd5;
}

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 60px);
  transition: grid-template-columns 0.22s ease;
}

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid #334155;
  color: #d3dbee;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: sticky;
  top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  min-height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  width: 240px;
  transition: width 0.22s ease, transform 0.2s ease, box-shadow 0.18s ease;
}

.app-shell.sidebar-collapsed .layout {
  grid-template-columns: 72px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .sidebar {
  width: 72px;
  min-width: 72px;
  transform: none;
  border-right: 1px solid #334155;
  overflow: visible;
  visibility: visible;
  pointer-events: auto;
}

.app-shell.sidebar-collapsed .sidebar:hover,
.app-shell.sidebar-collapsed .sidebar:focus-within {
  width: 240px;
  min-width: 240px;
  z-index: 20;
  box-shadow: 14px 0 26px rgba(15, 23, 42, 0.18);
}

.nav-group {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 12px 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-group::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.nav-heading {
  margin: 16px 10px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #91a3c5;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 4px;
  padding: 9px 10px;
  border-radius: 7px;
  color: #dbe6fe;
  font-size: 0.92rem;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.nav-link.active {
  background: rgba(59, 130, 246, 0.18);
  color: #ffffff;
}

.nav-subgroup {
  margin: 8px 14px 4px;
  color: #91a3c5;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-sub-link {
  margin-left: 18px;
  font-size: 0.88rem;
}

.nav-collapsible-nested {
  margin: 6px 0 4px 8px;
}

.nav-collapse-toggle-nested {
  padding: 6px 10px;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.nav-collapse-items-nested {
  margin-left: 10px;
  padding-left: 6px;
  border-left: 1px solid rgba(159, 179, 216, 0.16);
}

.nav-collapsible {
  margin: 4px 2px 2px;
}

.nav-collapse-toggle {
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #9fb3d8;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.nav-collapsible.open > .nav-collapse-toggle {
  background: rgba(148, 163, 184, 0.08);
  color: #cfe0ff;
  box-shadow: inset 2px 0 0 rgba(96, 165, 250, 0.68);
}

.nav-collapse-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #cfe0ff;
}

.nav-collapse-toggle:focus {
  outline: none;
}

.nav-collapse-toggle:focus-visible {
  outline: none;
  background: rgba(148, 163, 184, 0.10);
  box-shadow: inset 2px 0 0 rgba(147, 197, 253, 0.88);
}

.nav-collapse-items {
  display: none;
}

.nav-collapsible.open .nav-collapse-items {
  display: block;
}

.nav-collapse-caret {
  font-size: 0.75rem;
  transition: transform 0.18s ease;
}

.nav-collapsible.open .nav-collapse-caret {
  transform: rotate(180deg);
}

.core-dashboard-link {
  font-size: 0.98rem;
  font-weight: 600;
  padding-top: 11px;
  padding-bottom: 11px;
}

.nav-link.muted {
  color: #bfd0ee;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4b5563;
}

.nav-link.active .nav-dot {
  background: #67b1ff;
}

.nav-meta {
  margin: 2px 14px 10px 30px;
  color: #9bb1d6;
  font-size: 0.8rem;
  line-height: 1.45;
  word-break: break-all;
}

.security-compact .nav-heading {
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.security-compact {
  padding: 0 12px 18px;
  margin-top: auto;
}

.mobile-security-toggle {
  display: none;
}

.security-compact .nav-link {
  padding: 6px 10px;
  gap: 6px;
  font-size: 0.82rem;
}

.security-compact .nav-dot {
  width: 6px;
  height: 6px;
}

.security-compact .nav-meta {
  margin: 1px 12px 7px 24px;
  color: #94a9ce;
  font-size: 0.72rem;
  line-height: 1.3;
}

.sidebar-footer {
  border-top: 1px solid #334155;
  flex: 0 0 auto;
  background: var(--bg-sidebar);
  padding: 14px;
  display: grid;
  gap: 3px;
  color: #afc0dd;
  font-size: 0.82rem;
  box-shadow: 0 -12px 20px rgba(15, 23, 42, 0.18);
}

.sidebar-footer strong {
  color: #ffffff;
  font-weight: 600;
}

@media (min-width: 981px) {
  .app-shell.sidebar-collapsed .nav-group {
    padding: 14px 10px 16px;
  }

  .app-shell.sidebar-collapsed .security-compact {
    display: none;
  }

  .app-shell.sidebar-collapsed .nav-heading,
  .app-shell.sidebar-collapsed .nav-link > span,
  .app-shell.sidebar-collapsed .nav-collapse-toggle > span,
  .app-shell.sidebar-collapsed .sidebar-footer span,
  .app-shell.sidebar-collapsed .sidebar-footer strong {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .app-shell.sidebar-collapsed .nav-collapse-items {
    display: none;
  }

  .app-shell.sidebar-collapsed .nav-link,
  .app-shell.sidebar-collapsed .nav-collapse-toggle {
    position: relative;
    justify-content: center;
    width: 48px;
    height: 42px;
    margin: 4px auto;
    padding: 0;
    gap: 0;
  }

  .app-shell.sidebar-collapsed .nav-link::after,
  .app-shell.sidebar-collapsed .nav-collapse-toggle::after {
    content: attr(data-rail-label);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    color: #dbeafe;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
  }

  .app-shell.sidebar-collapsed .nav-link.active::after,
  .app-shell.sidebar-collapsed .nav-collapsible.open > .nav-collapse-toggle::after {
    background: rgba(59, 130, 246, 0.24);
    color: #ffffff;
  }

  .app-shell.sidebar-collapsed .nav-dot {
    display: none;
  }

  .app-shell.sidebar-collapsed .sidebar-footer {
    min-height: 58px;
    padding: 10px;
  }

  .app-shell.sidebar-collapsed .sidebar-footer::after {
    content: "ME";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0 auto;
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.18);
    color: #dbeafe;
    font-size: 0.72rem;
    font-weight: 900;
  }

  .app-shell.sidebar-collapsed .sidebar:hover .nav-group,
  .app-shell.sidebar-collapsed .sidebar:focus-within .nav-group {
    padding: 16px 12px 20px;
  }

  .app-shell.sidebar-collapsed .sidebar:hover .security-compact,
  .app-shell.sidebar-collapsed .sidebar:focus-within .security-compact {
    display: block;
  }

  .app-shell.sidebar-collapsed .sidebar:hover .nav-heading,
  .app-shell.sidebar-collapsed .sidebar:hover .nav-link > span,
  .app-shell.sidebar-collapsed .sidebar:hover .nav-collapse-toggle > span,
  .app-shell.sidebar-collapsed .sidebar:hover .sidebar-footer span,
  .app-shell.sidebar-collapsed .sidebar:hover .sidebar-footer strong,
  .app-shell.sidebar-collapsed .sidebar:focus-within .nav-heading,
  .app-shell.sidebar-collapsed .sidebar:focus-within .nav-link > span,
  .app-shell.sidebar-collapsed .sidebar:focus-within .nav-collapse-toggle > span,
  .app-shell.sidebar-collapsed .sidebar:focus-within .sidebar-footer span,
  .app-shell.sidebar-collapsed .sidebar:focus-within .sidebar-footer strong {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell.sidebar-collapsed .sidebar:hover .nav-link,
  .app-shell.sidebar-collapsed .sidebar:hover .nav-collapse-toggle,
  .app-shell.sidebar-collapsed .sidebar:focus-within .nav-link,
  .app-shell.sidebar-collapsed .sidebar:focus-within .nav-collapse-toggle {
    justify-content: flex-start;
    width: auto;
    height: auto;
    margin: 2px 4px;
    padding: 9px 10px;
    gap: 8px;
  }

  .app-shell.sidebar-collapsed .sidebar:hover .nav-collapse-toggle,
  .app-shell.sidebar-collapsed .sidebar:focus-within .nav-collapse-toggle {
    justify-content: space-between;
    padding: 7px 10px;
  }

  .app-shell.sidebar-collapsed .sidebar:hover .nav-link::after,
  .app-shell.sidebar-collapsed .sidebar:hover .nav-collapse-toggle::after,
  .app-shell.sidebar-collapsed .sidebar:focus-within .nav-link::after,
  .app-shell.sidebar-collapsed .sidebar:focus-within .nav-collapse-toggle::after,
  .app-shell.sidebar-collapsed .sidebar:hover .sidebar-footer::after,
  .app-shell.sidebar-collapsed .sidebar:focus-within .sidebar-footer::after {
    display: none;
  }

  .app-shell.sidebar-collapsed .sidebar:hover .nav-dot,
  .app-shell.sidebar-collapsed .sidebar:focus-within .nav-dot {
    display: inline-flex;
  }

  .app-shell.sidebar-collapsed .sidebar:hover .nav-collapsible.open .nav-collapse-items,
  .app-shell.sidebar-collapsed .sidebar:focus-within .nav-collapsible.open .nav-collapse-items {
    display: block;
  }
}

.content {
  padding: 20px clamp(14px, 3vw, 30px) 34px;
  animation: rise-in 280ms ease-out;
  min-width: 0;
  max-width: 100%;
}

.session-banner {
  margin-bottom: 14px;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f7fbff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.session-banner-sticky {
  position: sticky;
  top: 72px;
  z-index: 22;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.validation-wrap > .session-banner,
.validation-wrap > .global-notice-banner {
  margin-top: 0;
}

.session-text {
  margin: 0;
  font-size: 0.95rem;
  color: #203357;
}

.session-text strong {
  color: #0e498b;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-control-banner {
  margin-bottom: 14px;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  padding: 10px 14px;
  background: #f7fbff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-cache-status {
  order: -1;
  flex: 1 1 auto;
  min-width: 220px;
  margin: 0;
  border-radius: 999px;
  padding: 7px 11px;
  font-weight: 700;
}

.dashboard-cache-status.info {
  background: #eff6ff;
  color: #1d4ed8;
}

.dashboard-cache-status.warning {
  background: #fff7ed;
  color: #b45309;
}

.dashboard-cache-status.error {
  background: #fef2f2;
  color: #b91c1c;
}

.global-notice-banner {
  position: sticky;
  top: 72px;
  z-index: 14;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #f3d18b;
  border-radius: 12px;
  padding: 11px 14px;
  background: linear-gradient(90deg, #fff7dc 0%, #fff1c0 100%);
  color: #7c4a02;
  box-shadow: 0 10px 22px rgba(124, 74, 2, 0.12);
}

.global-notice-banner strong {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.global-notice-banner span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: pre-line;
  line-height: 1.5;
}

.global-notice-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(124, 74, 2, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: #7c4a02;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.global-notice-close:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(124, 74, 2, 0.42);
}

.global-loading {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(2px);
}

.global-loading-card {
  min-width: min(360px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 1px solid #dbe5f7;
  border-radius: 18px;
  padding: 24px 22px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
}

.global-loading-card p {
  margin: 0;
  color: #203557;
  font-size: 0.96rem;
  font-weight: 600;
}

.global-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #d8e4fa;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.page-head {
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4c6590;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.desc {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.92rem;
}

.desc.warning {
  margin-top: 6px;
  color: #b45309;
  font-weight: 600;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.metric-card {
  border-radius: 12px;
  padding: 14px;
  color: #1f2f4a;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
}

.metric-card h2 {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 600;
    opacity: 0.9;
  }

  .metric-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .metric-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: #55657f;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
  }

.metric-card p {
  margin: 12px 0 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.card-status {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.9;
}

.metric-card.stale {
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.25), var(--shadow);
}

.card-primary {
  background: #eef4ff;
  border-color: #bfd3ff;
  color: #123e8d;
}

.card-warning {
  background: #fff7ea;
  border-color: #ffdca1;
  color: #8a5000;
}

.card-success {
  background: #ecfaf3;
  border-color: #a9e2c7;
  color: #0f6a4a;
}

.card-danger {
  background: #fff0f3;
  border-color: #ffc1cb;
  color: #92243a;
}

.cp-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 154px;
}

.cp-kpi-main {
  margin: 4px 0 0;
  font-size: 2.05rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.cp-kpi-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.metric-pill.down {
  background: rgba(255, 255, 255, 0.58);
}

.metric-pill.flat {
  opacity: 0.86;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  min-width: 0;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 1rem;
}

.panel-head p {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.82rem;
}

.cp-scope-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 9px 13px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.btn.secondary {
  background: #5f6f8f;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.btn.device-revoke-btn {
  border: 1px solid #9f1239;
  background: #be123c;
  color: #fff;
  box-shadow: 0 4px 10px rgba(190, 18, 60, 0.2);
}

.btn.device-revoke-btn:hover,
.btn.device-revoke-btn:focus-visible {
  border-color: #881337;
  background: #9f1239;
}

.btn:hover {
  filter: brightness(0.96);
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ffe0e6;
  color: #b11840;
  font-size: 0.74rem;
  font-weight: 600;
}

.hidden {
  display: none;
}

.toast-stack {
  position: fixed;
  top: 76px;
  right: max(14px, calc((100vw - 1100px) / 2 + 14px));
  z-index: 1100;
  display: grid;
  gap: 8px;
  width: min(320px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 600;
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(2, 6, 23, 0.35);
  border: 1px solid transparent;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast * {
  color: #ffffff !important;
}

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

.toast.success {
  background: #0f766e;
  border-color: #0c5c56;
}

.toast.error {
  background: #b42318;
  border-color: #8f1a12;
}

.login-page {
  background:
    radial-gradient(circle at 10% 10%, rgba(31, 41, 55, 0.28), transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(13, 110, 253, 0.3), transparent 35%),
    #0f172a;
  color: #e8f0ff;
}

.login-shell {
  width: min(980px, 92vw);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
}

.login-aside {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: clamp(18px, 3vw, 28px);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.login-aside h1 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.login-notes {
  margin: 16px 0 0;
  padding: 0 0 0 16px;
  color: #c3d0e9;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.login-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.96);
  color: #1a2f51;
  padding: clamp(20px, 3vw, 26px);
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.35);
}

.login-card h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.login-form {
  display: grid;
  gap: 9px;
}

.login-form label {
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #324869;
}

.login-form input {
  height: 42px;
  border: 1px solid #c4d1e5;
  border-radius: 8px;
  padding: 0 10px;
}

.login-form input:focus {
  outline: 2px solid rgba(13, 110, 253, 0.2);
  border-color: #5898ff;
}

.login-submit {
  margin-top: 8px;
}

.device-approval-status {
  min-height: 44px;
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid #2f6fe4;
  background: #eef4ff;
  color: #1f355a;
  font-weight: 600;
  line-height: 1.5;
}

.device-approval-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.error {
  margin: 8px 0 12px;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
}

.success {
  margin: 8px 0 12px;
  color: #0b7a55;
  font-size: 0.9rem;
  font-weight: 600;
}

.validation-wrap {
  width: min(1100px, 92vw);
  margin: 18px auto 36px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.validation-wrap-wide {
  width: min(1500px, 100%);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #d9e3f3;
  border-radius: 12px;
}

.table-scroll .compare-table {
  border: 0;
}

.table-scroll .compare-table th,
.table-scroll .compare-table td {
  white-space: nowrap;
}

.compare-table th,
.compare-table td {
  border: 1px solid #d9e3f3;
  padding: 10px;
  text-align: left;
}

.compare-table thead th {
  background: #f3f7ff;
  color: #1f355a;
}

.compare-meta {
  background: #0f172a;
  color: #ffffff;
  border-radius: 10px;
  padding: 12px;
  max-height: 320px;
  overflow: auto;
  font-size: 0.8rem;
}

.otp-qr-block {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.otp-qr-block.hidden {
  display: none;
}

.otp-qr-image {
  width: min(220px, 100%);
  height: auto;
  background: #fff;
  border: 1px solid #d7e3f8;
  border-radius: 12px;
  padding: 10px;
}

.otp-qr-help {
  margin: 0;
  font-size: 0.85rem;
  color: #c4d4f5;
}

.otp-uri-details summary {
  cursor: pointer;
  color: #c9d9f7;
  font-size: 0.85rem;
}

.otp-uri-details .compare-meta {
  margin-top: 8px;
}

.admin-kpi-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.admin-kpi {
  background: #f5f8ff;
  border: 1px solid #d8e3f6;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

button.admin-kpi {
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.cp-inv-kpi-filter {
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.cp-inv-kpi-filter:hover,
.cp-inv-kpi-filter.active {
  border-color: #3b82f6;
  background: #eef5ff;
  transform: translateY(-1px);
}

.cp-inv-kpi-filter.active span,
.cp-inv-kpi-filter.active strong {
  color: #0b55d9;
}

.cp-inv-kpi-filter:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.22);
  outline-offset: 2px;
}

.admin-kpi span {
  font-size: 0.74rem;
  color: #5e6f8a;
}

.admin-kpi strong {
  font-size: 1.1rem;
}

.admin-form {
  display: grid;
  gap: 8px;
  max-width: 540px;
}

.ai-usage-filter-grid {
  max-width: none;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
  align-items: end;
  margin: 14px 0 12px;
}

.ai-usage-filter-grid label {
  display: grid;
  gap: 5px;
  color: #425674;
  font-size: 0.78rem;
  font-weight: 800;
}

.ai-usage-kpis {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.ai-usage-table-scroll {
  max-height: 560px;
  overflow: auto;
  border: 1px solid #e0e7f2;
  border-radius: 12px;
}

.ai-usage-user-scroll {
  max-height: 360px;
  overflow: auto;
  border: 1px solid #e0e7f2;
  border-radius: 12px;
}

.ai-usage-table {
  min-width: 1740px;
}

.ai-usage-table th,
.ai-usage-table td {
  vertical-align: top;
  white-space: nowrap;
}

.ai-usage-table .ai-usage-question {
  min-width: 320px;
  max-width: 520px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.ai-usage-question small {
  display: block;
  margin-top: 4px;
  color: #a15c16;
  font-size: 0.68rem;
}

.ai-usage-status {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
}

.ai-usage-status.success {
  background: #e7f8ee;
  color: #167345;
}

.ai-usage-status.error {
  background: #fff0f0;
  color: #b4232d;
}

.ai-usage-mode {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf2f9;
  color: #49607f;
  font-size: 0.7rem;
  font-weight: 900;
}

.ai-usage-mode.deep {
  background: #eee9ff;
  color: #5f42a5;
}

.ai-usage-subtitle {
  margin: 18px 0 8px;
  color: #233b60;
  font-size: 0.95rem;
}

@media (max-width: 980px) {
  .ai-usage-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .ai-usage-filter-grid {
    grid-template-columns: 1fr;
  }
}

.admin-inline-status {
  margin: 4px 0 10px;
  font-size: 0.85rem;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.compare-table select {
  height: 38px;
  border: 1px solid #c4d1e5;
  border-radius: 8px;
  padding: 0 8px;
}

.admin-form textarea {
  min-height: 96px;
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #334968;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.compare-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.po-form-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
  align-items: start;
}

.cp-alert-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.po-box {
  border: 1px solid #d8e4f6;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f8ff 100%);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.po-box h3 {
  margin: 0;
  font-size: 0.93rem;
  color: #203557;
}

.po-box label {
  font-size: 0.83rem;
  font-weight: 700;
  color: #304a74;
}

.po-box input,
.po-box select {
  height: 40px;
  border: 1px solid #bfcee4;
  border-radius: 9px;
  padding: 0 10px;
  background: #ffffff;
  color: #132b4f;
}

.po-box input:focus,
.po-box select:focus {
  outline: 2px solid rgba(13, 110, 253, 0.18);
  border-color: #5e98e7;
}

.po-box .desc {
  font-size: 0.82rem;
  color: #4f6488;
}

.po-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.po-date-box {
  border-color: #cddffb;
  background: linear-gradient(180deg, #f8fcff 0%, #eef4ff 100%);
}

.po-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.po-date-input-wrap {
  position: relative;
}

#poStartDate,
#poEndDate {
  background: #ffffff;
  min-width: 0;
  padding-right: 42px;
}

.po-date-open-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #27456f;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.po-date-open-btn:hover,
.po-date-open-btn:focus-visible {
  background: #eef4ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.po-date-open-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.po-date-open-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.po-date-quick-anchor {
  position: relative;
  min-height: 0;
}

.po-date-quick-popover {
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  width: min(940px, calc(100vw - 28px));
  max-height: calc(100vh - 136px);
  z-index: 14;
  border: 1px solid #c9d9f3;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.po-date-quick-popover.open {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: stretch;
}

.po-date-preset-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: #f7faff;
  border-right: 1px solid #d7e3f7;
  max-height: none;
  overflow-y: auto;
}

.po-date-preset-list .quick-chip {
  width: 100%;
  text-align: left;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.po-date-picker-main {
  padding: 10px 12px 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.po-range-calendar .flatpickr-calendar.inline {
  width: auto;
  min-width: 0;
  max-width: 100%;
  box-shadow: none;
  border: 0;
  margin: 0;
}

/* App-wide `.hidden { display:none }` must not hide flatpickr day cells. */
.po-range-calendar .flatpickr-day.hidden {
  display: inline-block !important;
  visibility: hidden !important;
}

.po-range-calendar {
  overflow: hidden;
}

.po-range-calendar-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.po-calendar-fallback {
  margin: 0;
  padding: 14px 10px;
  border: 1px dashed #bfd0e8;
  border-radius: 8px;
  font-size: 0.84rem;
  color: #35547f;
  background: #f7fbff;
}

.po-range-calendar .flatpickr-months {
  border-bottom: 1px solid #e1e9f6;
  padding-bottom: 6px;
}

.po-range-calendar .flatpickr-current-month {
  font-size: 1rem;
}

.po-range-preview {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #dbe5f5;
  border-radius: 8px;
  background: #f8fbff;
  font-size: 0.84rem;
  color: #274062;
}

.po-date-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 980px) {
  .po-date-quick-popover {
    width: min(96vw, 860px);
    max-height: calc(100vh - 90px);
  }

  .po-date-quick-popover.open {
    grid-template-columns: 1fr;
  }

  .po-date-preset-list {
    border-right: 0;
    border-bottom: 1px solid #d7e3f7;
    max-height: 152px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .po-range-calendar .flatpickr-calendar.inline { min-width: 320px; }
}

.po-search-wrap {
  position: relative;
}

.po-search-wrap input {
  width: 100%;
  padding-right: 54px;
}

.po-search-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 42px;
  height: calc(100% - 2px);
  border: 0;
  border-left: 1px solid #d2ddef;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(180deg, #fbfdff 0%, #eef4ff 100%);
  color: #36537d;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.po-search-toggle:hover,
.po-search-toggle[aria-expanded="true"] {
  background: linear-gradient(180deg, #eef4ff 0%, #e3efff 100%);
  color: #17448a;
}

.po-search-toggle[aria-expanded="true"] {
  transform: rotate(180deg);
}

.po-compare-controls {
  display: flex;
}

.po-compare-wrap {
  border: 1px solid #d6e0ef;
  border-radius: 9px;
  background: #ffffff;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.po-compare-title {
  margin: 0;
  font-size: 0.82rem;
  color: #304a74;
  font-weight: 700;
}

.po-compare-list {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
}

.po-compare-empty {
  margin: 0;
  font-size: 0.82rem;
  color: #5a6f92;
}

.po-compare-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #dce5f4;
  border-radius: 8px;
  background: #f8fbff;
  padding: 6px 8px;
}

.po-compare-name {
  font-size: 0.84rem;
  color: #213b62;
  line-height: 1.2;
  word-break: break-all;
}

.po-compare-color {
  width: 34px;
  height: 28px;
  border: 1px solid #c4d2e8;
  border-radius: 6px;
  padding: 0;
  background: #fff;
  cursor: pointer;
}

.po-compare-remove {
  border: 1px solid #c7d4ea;
  border-radius: 8px;
  background: #fff;
  color: #334d74;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
}

.po-compare-remove:hover {
  background: #eef4ff;
}

.po-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.po-option-head label {
  margin: 0;
}

.po-option-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.po-option-bulk-btn {
  border: 1px solid #c7d4ea;
  border-radius: 7px;
  background: #ffffff;
  color: #2f4c76;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
}

.po-option-bulk-btn:hover:not(:disabled) {
  background: #eef4ff;
}

.po-option-bulk-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.po-option-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #365072;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.po-option-mode-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.po-option-mode-switch {
  position: relative;
  width: 34px;
  height: 18px;
  flex: 0 0 34px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background-color 0.16s ease;
}

.po-option-mode-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.24);
  transition: transform 0.16s ease;
}

.po-option-mode-toggle input:checked + .po-option-mode-switch {
  background: #2563eb;
}

.po-option-mode-toggle input:checked + .po-option-mode-switch::after {
  transform: translateX(16px);
}

.po-option-mode-toggle:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

.po-option-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 7px;
  max-height: 132px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #d6e0ef;
  border-radius: 8px;
  background: #ffffff;
}

.po-option-check {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #e2eaf6;
  border-radius: 999px;
  background: #f8fbff;
  color: #213b62;
  font-size: 0.82rem;
  line-height: 1.25;
  cursor: pointer;
}

.po-option-check input {
  margin: 0;
}

.po-option-check span {
  min-width: 0;
  word-break: break-all;
}

.po-option-check-text {
  display: grid;
  gap: 1px;
  line-height: 1.16;
}

.po-option-label-main {
  font-weight: 700;
  color: inherit;
}

.po-option-label-barcode {
  font-size: 0.74rem;
  font-weight: 600;
  color: #7b8797;
}

.po-chart-legend {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #dbe5f3;
}

.po-chart-legend-row {
  display: grid;
  grid-template-columns: minmax(130px, 220px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.po-chart-legend-title {
  min-width: 0;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-chart-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.po-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 1px 0;
  border: 0;
  background: transparent;
  color: #586579;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.po-chart-legend-item.is-hidden {
  opacity: 0.42;
  text-decoration: line-through;
}

.po-chart-legend-swatch {
  display: inline-block;
  flex: 0 0 auto;
  width: 20px;
  height: 9px;
  border: 2px solid #64748b;
  border-radius: 2px;
}

.po-chart-legend-swatch.is-line {
  height: 0;
  border-width: 0 0 2px;
  border-radius: 0;
  background: transparent;
}

.po-chart-legend-metric {
  white-space: nowrap;
}

.po-option-check:has(input:checked) {
  border-color: #9bbcf0;
  background: #eef5ff;
  font-weight: 700;
}

.po-option-empty {
  margin: 0;
  color: #5a6f92;
  font-size: 0.82rem;
}

.po-suggest {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 30;
  border: 1px solid #bfcee4;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.14);
  max-height: 250px;
  overflow-y: auto;
}

.po-suggest-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid #edf2fb;
  background: #ffffff;
  text-align: left;
  padding: 9px 10px;
  color: #1a3359;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.po-suggest-item:last-child {
  border-bottom: none;
}

.po-suggest-item:hover {
  background: #eef5ff;
}

.po-suggest-empty {
  margin: 0;
  padding: 10px;
  font-size: 0.84rem;
  color: #5a6f92;
}

.po-suggest-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #14335c;
}

.po-suggest-meta {
  font-size: 0.76rem;
  color: #5a6f92;
}

.po-seller-box .btn.secondary {
  padding: 6px 12px;
  border: 1px solid #566a90;
  background: #5f7299;
}

.po-seller-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid #d4e0f3;
  background: #ffffff;
  border-radius: 9px;
  padding: 9px;
  max-height: 180px;
  overflow-y: auto;
}

.po-seller-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  color: #2a4064;
  line-height: 1.2;
}

.po-seller-item-all {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  padding: 0 0 8px;
  border-bottom: 1px dashed #d5deed;
  font-weight: 700;
}

.po-seller-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.po-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.po-actions .btn {
  min-width: 112px;
}

.po-csv-btn {
  border: 1px solid #475c82;
  background: #51678f;
  font-weight: 700;
}

.slow-stock-wrap {
  gap: 14px;
  --slow-stock-filter-top: 72px;
}

.slow-stock-wrap:has(> #globalNoticeBanner) {
  --slow-stock-filter-top: 132px;
}

.slow-stock-filter-panel .panel-head {
  margin-bottom: 6px;
}

.slow-stock-filter-panel {
  position: sticky;
  top: var(--slow-stock-filter-top);
  z-index: 13;
  width: 100%;
  margin-inline: 0;
  border-color: #cfe0ff;
  background: rgba(248, 251, 255, 0.96);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(8px);
}

.panel.panel-compact.slow-stock-filter-panel {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  padding: 8px 12px 9px;
}

.slow-stock-filter-head {
  align-items: center;
}

.slow-stock-filter-head h2 {
  font-size: 0.95rem;
}

.slow-stock-filter-head .slow-stock-segmented {
  flex: 0 0 auto;
}

.slow-stock-filter-grid {
  display: grid;
  gap: 6px;
}

.slow-stock-primary-filters,
.slow-stock-view-tools {
  display: grid;
  gap: 10px;
  align-items: end;
}

.slow-stock-primary-filters {
  grid-template-columns: minmax(360px, 1fr) minmax(160px, 0.24fr) minmax(160px, 0.24fr) auto;
}

.slow-stock-view-tools {
  grid-template-columns: minmax(360px, max-content) minmax(0, 1fr);
  padding-top: 8px;
  border-top: 1px solid #e4ebf6;
}

.slow-stock-filter-grid label,
.slow-stock-segmented {
  display: grid;
  gap: 3px;
  color: #304a74;
  font-size: 0.76rem;
  font-weight: 700;
}

.slow-stock-filter-grid input,
.slow-stock-filter-grid select {
  height: 34px;
  min-width: 0;
  border: 1px solid #c4d1e5;
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: #17233b;
}

.slow-stock-filter-grid input:focus,
.slow-stock-filter-grid select:focus {
  border-color: #5898ff;
  outline: 3px solid rgba(37, 99, 235, 0.14);
}

.slow-stock-segmented {
  display: inline-flex;
  min-width: 0;
  height: 32px;
  padding: 2px;
  gap: 3px;
  border: 1px solid #c4d1e5;
  border-radius: 8px;
  background: #eef4fd;
  align-self: end;
}

.slow-stock-segmented button {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  padding: 0 9px;
  background: transparent;
  color: #304a74;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.slow-stock-segmented button.active {
  background: #ffffff;
  color: #1d4ed8;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.12);
}

.slow-stock-segmented button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
}

.slow-stock-check-label {
  align-self: stretch;
  min-height: 39px;
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 8px !important;
  padding: 19px 4px 0;
}

.slow-stock-check-label input {
  width: 17px;
  height: 17px;
  padding: 0;
}

.slow-stock-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
  flex-wrap: wrap;
}

.slow-stock-main-actions {
  min-width: 248px;
}

.slow-stock-actions .btn {
  min-height: 34px;
}

.slow-stock-filter-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  white-space: nowrap;
}

.slow-stock-filter-meta .desc {
  min-width: 0;
  overflow: hidden;
  color: #5b6f8f;
  font-size: 0.78rem;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.slow-stock-filter-meta #slowStockStatus {
  flex: 0 0 auto;
}

.slow-stock-filter-meta #slowStockMeta {
  flex: 1 1 auto;
}

.slow-stock-kpis {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(210px, 1.35fr) repeat(4, minmax(118px, 0.82fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #d9e3f3;
  border-radius: 10px;
  background: #eef4fb;
}

.slow-stock-kpis .admin-kpi {
  min-height: 64px;
  border-radius: 9px;
  padding: 9px 10px 8px 14px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.slow-stock-kpi-card {
  position: relative;
}

.slow-stock-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #5b7ca8;
}

.slow-stock-kpi-card span {
  color: #47617f;
  font-size: 0.72rem;
  font-weight: 800;
}

.slow-stock-kpis .admin-kpi strong {
  color: #17233b;
  font-size: 0.98rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.slow-stock-kpi-money strong {
  color: #0f2f5f;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slow-stock-kpi-danger strong {
  color: #b91c1c;
}

.slow-stock-kpi-count::before {
  background: #5b7ca8;
}

.slow-stock-kpi-money::before {
  background: #315f93;
}

.slow-stock-kpi-danger::before {
  background: #ef4444;
}

.slow-stock-change-kpi {
  grid-column: 1 / -1;
  background: #f7fbff !important;
  overflow: visible !important;
  position: relative;
  z-index: 3;
}

.slow-stock-change-kpi:hover,
.slow-stock-change-kpi:focus-within {
  z-index: 30;
}

.slow-stock-change-kpi::before {
  background: #2563eb;
}

.slow-stock-change-kpi > strong {
  color: #0f2f5f;
  font-size: 1.05rem !important;
  padding-right: 108px;
}

.slow-stock-change-detail-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  min-height: 30px;
  padding: 5px 9px;
  border-color: #c7d5eb;
  background: #f8fbff;
  color: #25446f;
  font-size: 0.76rem;
  font-weight: 900;
}

.slow-stock-change-period {
  display: block;
  margin-top: 3px;
  color: #55708f;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.slow-stock-change-kpi[data-change="improved"]::before {
  background: #10b981;
}

.slow-stock-change-kpi[data-change="worsened"]::before {
  background: #ef4444;
}

.slow-stock-change-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.slow-stock-change-lines p {
  margin: 0;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  background: #ffffff;
}

.slow-stock-change-lines b {
  color: #47617f;
  font-size: 0.76rem;
}

.slow-stock-change-lines em {
  color: #17233b;
  font-style: normal;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.slow-stock-change-lines small {
  color: #55708f;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
}

.slow-stock-change-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  padding-top: 10px;
  border-top: 1px solid #dbe7f6;
  overflow: visible;
}

.slow-stock-change-details p {
  margin: 0;
  min-width: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.slow-stock-change-details b {
  flex: 0 0 auto;
  color: #47617f;
  font-size: 0.76rem;
}

.slow-stock-change-chip {
  position: relative;
  z-index: 1;
  min-height: 24px;
  min-width: 58px;
  border: 1px solid #c9d8ee;
  border-radius: 999px;
  padding: 3px 10px;
  background: #ffffff;
  color: #17345d;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  cursor: help;
}

.slow-stock-change-chip.is-empty {
  color: #8a9bb3;
  background: #f8fafc;
}

.slow-stock-change-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  bottom: auto;
  width: min(560px, calc(100vw - 48px));
  max-width: none;
  padding: 10px 12px;
  border: 1px solid #cbd8ee;
  border-radius: 8px;
  background: #10213d;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 80;
}

.slow-stock-change-chip:hover,
.slow-stock-change-chip:focus-visible {
  z-index: 90;
}

.slow-stock-change-chip:hover::after,
.slow-stock-change-chip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.slow-stock-change-chip:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

/* legacy span fallback */
.slow-stock-change-details span {
  color: #17233b;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.slow-stock-change-details p:nth-child(2n) .slow-stock-change-chip::after {
  left: auto;
  right: 0;
}

.slow-stock-change-details p {
  position: relative;
}

.mk-modal .slow-stock-change-modal-card {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
}

.slow-stock-change-modal-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 10px;
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  background: #f7fbff;
}

.slow-stock-change-modal-tools label {
  display: grid;
  gap: 5px;
  color: #47617f;
  font-size: 0.78rem;
  font-weight: 800;
}

.slow-stock-change-modal-tools input {
  height: 38px;
  border: 1px solid #c4d1e5;
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: #17233b;
  font: inherit;
}

.slow-stock-change-modal-tools input:focus {
  border-color: #5898ff;
  outline: 3px solid rgba(37, 99, 235, 0.14);
}

.slow-stock-change-modal-tools strong {
  min-width: 112px;
  color: #0f2f5f;
  font-size: 0.9rem;
  text-align: right;
  white-space: nowrap;
}

.slow-stock-change-list {
  min-height: 260px;
  max-height: min(62vh, 620px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  padding-right: 4px;
}

.slow-stock-change-list-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  background: #ffffff;
}

.slow-stock-change-list-item > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  background: #eef4fd;
  color: #315f93;
  font-size: 0.76rem;
  font-weight: 900;
}

.slow-stock-change-list-item strong {
  display: block;
  color: #17233b;
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.slow-stock-change-list-item small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.slow-stock-change-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e3ebf6;
  background: #ffffff;
}

.mk-modal .slow-stock-okr-modal-card {
  width: min(1180px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  gap: 12px;
  padding-bottom: 18px;
}

.slow-stock-okr-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) repeat(3, minmax(130px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dbe7f6;
  border-radius: 10px;
  background: #f7fbff;
}

.slow-stock-okr-controls label {
  display: grid;
  gap: 5px;
  color: #47617f;
  font-size: 0.78rem;
  font-weight: 900;
}

.slow-stock-okr-seller-field {
  display: grid;
  gap: 5px;
  color: #47617f;
  font-size: 0.78rem;
  font-weight: 900;
}

.slow-stock-okr-seller-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 38px;
  max-height: 88px;
  overflow: auto;
  padding: 5px;
  border: 1px solid #c4d1e5;
  border-radius: 8px;
  background: #ffffff;
}

.slow-stock-seller-chip {
  display: inline-flex !important;
  grid-auto-flow: column;
  align-items: center;
  gap: 5px !important;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #d3dff0;
  border-radius: 999px;
  background: #f8fbff;
  color: #173052 !important;
  font-size: 0.76rem !important;
  white-space: nowrap;
  cursor: pointer;
}

.slow-stock-seller-chip:has(input:checked) {
  border-color: #2563eb;
  background: #eaf2ff;
  color: #0b4fc7 !important;
}

.slow-stock-seller-chip input {
  width: 13px !important;
  height: 13px !important;
  margin: 0;
  padding: 0;
  accent-color: #2563eb;
}

.slow-stock-okr-seller-field[aria-busy="true"] .slow-stock-okr-seller-options {
  opacity: 0.62;
}

.slow-stock-okr-seller-field small {
  min-height: 15px;
  color: #607797;
  font-size: 0.72rem;
  font-weight: 800;
}

.slow-stock-okr-controls input,
.slow-stock-okr-controls select {
  height: 38px;
  border: 1px solid #c4d1e5;
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: #17233b;
  font: inherit;
  font-weight: 800;
}

.slow-stock-okr-controls .slow-stock-seller-chip input {
  width: 13px !important;
  height: 13px !important;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.slow-stock-okr-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.slow-stock-okr-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.slow-stock-okr-summary article {
  border: 1px solid #dbe7f6;
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.slow-stock-okr-summary span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
}

.slow-stock-okr-summary strong {
  color: #0b2d5b;
  font-size: 1.05rem;
}

.slow-stock-title-with-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.slow-stock-title-with-help h2 {
  margin: 0;
}

.slow-stock-title-with-help .slow-stock-help-card {
  right: auto;
  left: 0;
}

.slow-stock-okr-help .slow-stock-help-card {
  right: auto;
  left: 0;
  width: min(560px, calc(100vw - 32px));
}

.slow-stock-okr-chart-shell {
  height: min(260px, 30vh);
  min-height: 220px;
}

.slow-stock-okr-table-scroll {
  max-height: min(380px, 34vh);
  overflow-x: auto;
  overflow-y: auto;
  padding-bottom: 8px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.slow-stock-okr-table-panel {
  margin-bottom: 10px;
}

.slow-stock-okr-table td small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
}

.slow-stock-okr-table tr.slow-stock-okr-recalculating td:not(:first-child) {
  background: #fff8d8;
}

.slow-stock-okr-table tr.slow-stock-okr-recalculating:hover td:not(:first-child) {
  background: #fff2b5;
}

.slow-stock-progress-blocker {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
}

.slow-stock-progress-blocker.hidden {
  display: none;
}

.slow-stock-progress-card {
  width: min(520px, 92vw);
  padding: 22px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  color: #0f2f5f;
}

.slow-stock-progress-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.slow-stock-progress-card p {
  min-height: 22px;
  margin: 0 0 14px;
  color: #475569;
}

.slow-stock-progress-track {
  overflow: hidden;
  height: 16px;
  border-radius: 999px;
  background: #e5eefb;
}

.slow-stock-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  transition: width 0.25s ease;
}

.slow-stock-progress-card em {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
  color: #0b3a78;
}

.slow-stock-progress-card small {
  display: block;
  margin-top: 12px;
  color: #64748b;
}

.text-good {
  color: #047857;
}

.text-danger {
  color: #dc2626;
}

.slow-stock-kpi-meta {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
}

.slow-stock-zone-kpi {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 2px 7px;
}

.slow-stock-zone-kpi span {
  grid-column: 1 / -1;
}

.slow-stock-zone-kpi strong {
  grid-column: 1;
  font-size: 0.86rem;
  white-space: nowrap;
}

.slow-stock-zone-kpi .slow-stock-kpi-meta {
  grid-column: 2;
  align-self: end;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slow-stock-zone-kpi-slow::before {
  background: #ef4444;
}

.slow-stock-zone-kpi-slow {
  background: #fff7f7 !important;
}

.slow-stock-zone-kpi-caution::before {
  background: #f59e0b;
}

.slow-stock-zone-kpi-caution {
  background: #fffbeb !important;
}

.slow-stock-zone-kpi-good::before {
  background: #10b981;
}

.slow-stock-zone-kpi-good {
  background: #f0fdf7 !important;
}

.slow-stock-zone-kpi-shortage::before {
  background: #3b82f6;
}

.slow-stock-zone-kpi-shortage {
  background: #eff6ff !important;
}

.slow-stock-zone-kpi-no-sales::before {
  background: #94a3b8;
}

.slow-stock-zone-kpi-no-sales {
  background: #f8fafc !important;
}

.slow-stock-map-panel {
  overflow: hidden;
}

.slow-stock-map-head {
  align-items: flex-start;
  gap: 12px;
}

.slow-stock-map-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 700;
}

.slow-stock-map-body {
  height: 680px;
  margin-top: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding-bottom: 8px;
}

.slow-stock-map-body::-webkit-scrollbar {
  height: 10px;
}

.slow-stock-map-body::-webkit-scrollbar-track {
  background: #eef4fd;
  border-radius: 999px;
}

.slow-stock-map-body::-webkit-scrollbar-thumb {
  background: #9eb5d4;
  border-radius: 999px;
}

.slow-stock-map-canvas-track {
  width: max(100%, 2240px);
  height: 100%;
  min-width: 100%;
}

.slow-stock-map-panel.is-collapsed .slow-stock-map-body {
  display: none;
}

.slow-stock-table-head,
.slow-stock-detail-head {
  align-items: flex-start;
  gap: 12px;
}

.slow-stock-head-actions,
.slow-stock-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.slow-stock-help {
  flex: 0 0 auto;
}

.slow-stock-help .slow-stock-help-card {
  width: min(660px, calc(100vw - 32px));
  max-height: min(560px, 70vh);
  overflow: auto;
}

.slow-stock-help-card b {
  color: #0f2f5f;
}

.slow-stock-help-danger {
  margin: 8px 0 0;
  color: #b91c1c;
  font-weight: 800;
  line-height: 1.55;
}

.slow-stock-help-danger a {
  color: #b91c1c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.slow-stock-table-scroll {
  max-height: 620px;
  overflow: auto;
  border-radius: 8px;
}

.slow-stock-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.slow-stock-table thead th.slow-stock-sortable-head {
  padding: 0;
}

.slow-stock-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 100%;
  padding: 10px 5px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
}

.slow-stock-table thead th:first-child .slow-stock-sort-button {
  justify-content: space-between;
  gap: 6px;
  padding-inline: 8px;
}

.slow-stock-sort-button:hover {
  background: rgba(37, 99, 235, 0.06);
}

.slow-stock-sort-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: -2px;
  border-radius: 6px;
}

.slow-stock-sort-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slow-stock-sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 10px;
  width: 10px;
  min-width: 10px;
  color: #7b8da8;
  font-size: 0.72rem;
  line-height: 1;
}

.slow-stock-table thead th[data-sort-state="desc"] .slow-stock-sort-icon,
.slow-stock-table thead th[data-sort-state="asc"] .slow-stock-sort-icon {
  color: #2563eb;
  font-weight: 900;
}

.slow-stock-table th:first-child,
.slow-stock-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}

.slow-stock-table thead th:first-child {
  z-index: 3;
}

.slow-stock-table tbody tr:nth-child(even) td {
  background-color: #fbfdff;
}

.slow-stock-table td.num,
.slow-stock-option-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.slow-stock-table td.slow-stock-slow-share,
.slow-stock-option-table td.slow-stock-slow-share {
  background: rgba(239, 68, 68, var(--slow-share-alpha, 0.08)) !important;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, var(--slow-share-border-alpha, 0.18));
  color: var(--slow-share-color, #7f1d1d);
  font-weight: 900;
  white-space: nowrap;
}

.slow-stock-row {
  cursor: pointer;
}

.slow-stock-row:hover td,
.slow-stock-row.active td {
  background-color: #eef6ff;
}

.slow-stock-row.active .slow-stock-product-cell {
  box-shadow: inset 4px 0 0 #2563eb;
}

.slow-stock-row:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: -3px;
}

.slow-stock-product-cell {
  min-width: 320px;
  border-left: 6px solid rgba(30, 64, 175, 0.35) !important;
  background-clip: padding-box;
}

.slow-stock-product-cell strong,
.slow-stock-product-cell span {
  display: block;
}

.slow-stock-product-cell strong {
  color: #17233b;
  line-height: 1.35;
}

.slow-stock-product-cell span {
  margin-top: 3px;
  color: #64748b;
  font-size: 0.78rem;
}

.slow-stock-zone,
.slow-stock-confidence {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.slow-stock-confidence {
  border: 0;
  background: #fef3c7;
  color: #b45309;
  cursor: pointer;
  font-family: inherit;
}

.slow-stock-confidence:hover,
.slow-stock-confidence:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.slow-stock-confidence.is-high {
  background: #dcfce7;
  color: #047857;
}

.slow-stock-confidence.is-mid {
  background: #fef3c7;
  color: #b45309;
}

.slow-stock-confidence.is-low {
  background: #fee2e2;
  color: #b91c1c;
}

.slow-stock-zone-0 {
  background: #f1f5f9;
  color: #64748b;
}

.slow-stock-zone-1,
.slow-stock-zone-2 {
  background: #dbeafe;
  color: #1d4ed8;
}

.slow-stock-zone-3 {
  background: #dcfce7;
  color: #047857;
}

.slow-stock-zone-4 {
  background: #fef3c7;
  color: #b45309;
}

.slow-stock-zone-5 {
  background: #fee2e2;
  color: #b91c1c;
}

.slow-stock-zone-new-model {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

.slow-stock-new-model-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.slow-stock-new-model-cell small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
}

.slow-stock-new-model-complete {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 800;
}

.slow-stock-new-model-empty {
  color: #94a3b8;
  font-weight: 700;
}

.btn.tiny.slow-stock-new-model-btn {
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 0.72rem;
}

.slow-stock-detail-panel {
  scroll-margin-top: 82px;
}

#slowStockListPanel {
  scroll-margin-top: 94px;
}

.slow-stock-detail-panel.is-loading {
  opacity: 0.78;
}

.slow-stock-detail-head p {
  margin: 5px 0 0;
  color: #5d708f;
  font-size: 0.9rem;
}

.slow-stock-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.slow-stock-chart-box {
  min-height: 290px;
  border: 1px solid #d9e3f3;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.slow-stock-option-scroll {
  max-height: 500px;
  overflow: auto;
}

.slow-stock-option-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.slow-stock-option-row {
  cursor: pointer;
}

.slow-stock-option-row:not(.is-disabled):hover td,
.slow-stock-option-row:not(.is-disabled):focus-visible td {
  background: #eff6ff;
}

.slow-stock-option-row.is-disabled {
  cursor: default;
}

.slow-stock-option-row.is-disabled td {
  color: #94a3b8;
}

.slow-stock-order-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e3ebf6;
}

.slow-stock-order-range {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.slow-stock-order-chart-shell {
  min-height: 330px;
}

.slow-stock-seller-breakdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: #17233b;
}

.slow-stock-seller-title,
.slow-stock-seller-empty,
.slow-stock-seller-more {
  font-size: 0.82rem;
  font-weight: 800;
  color: #5d708f;
}

.slow-stock-seller-chip {
  --seller-color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--seller-color) 28%, #d8e4f4);
  border-radius: 999px;
  background: color-mix(in srgb, var(--seller-color) 8%, #ffffff);
  font-size: 0.76rem;
  line-height: 1;
}

.slow-stock-seller-chip i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--seller-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--seller-color) 18%, transparent);
}

.slow-stock-seller-chip b {
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slow-stock-seller-chip em {
  font-style: normal;
  font-weight: 900;
}

.slow-stock-seller-chip small {
  color: #5d708f;
  font-weight: 800;
}

.slow-stock-option-modal-card {
  width: min(1120px, calc(100vw - 28px));
}

.mk-modal .slow-stock-evidence-modal-card {
  width: calc(100vw - 32px);
  max-width: none;
  max-height: calc(100vh - 28px);
  overflow: hidden;
  padding: 14px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.slow-stock-evidence-scroll {
  max-height: calc(100vh - 242px);
  overflow-x: hidden;
  overflow-y: auto;
}

.slow-stock-evidence-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
  background: #ffffff;
}

.slow-stock-evidence-footer .btn {
  min-width: 112px;
}

.slow-stock-evidence-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 0.76rem;
}

.slow-stock-evidence-table th,
.slow-stock-evidence-table td {
  padding: 7px 5px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.slow-stock-evidence-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.slow-stock-evidence-table th:nth-child(1),
.slow-stock-evidence-table td:nth-child(1) {
  width: 5%;
}

.slow-stock-evidence-table th:nth-child(2),
.slow-stock-evidence-table td:nth-child(2) {
  width: 4%;
}

.slow-stock-evidence-table th:nth-child(3),
.slow-stock-evidence-table td:nth-child(3) {
  width: 3%;
}

.slow-stock-evidence-table th:nth-child(4),
.slow-stock-evidence-table td:nth-child(4) {
  width: 8%;
}

.slow-stock-evidence-table th:nth-child(5),
.slow-stock-evidence-table td:nth-child(5) {
  width: 5%;
}

.slow-stock-evidence-table th:nth-child(6),
.slow-stock-evidence-table td:nth-child(6) {
  width: 11%;
  white-space: normal;
}

.slow-stock-evidence-table th:nth-child(7),
.slow-stock-evidence-table td:nth-child(7) {
  width: 7%;
  white-space: normal;
}

.slow-stock-evidence-table th:nth-child(8),
.slow-stock-evidence-table td:nth-child(8) {
  width: 5%;
}

.slow-stock-evidence-table th:nth-child(9),
.slow-stock-evidence-table td:nth-child(9),
.slow-stock-evidence-table th:nth-child(10),
.slow-stock-evidence-table td:nth-child(10),
.slow-stock-evidence-table th:nth-child(11),
.slow-stock-evidence-table td:nth-child(11) {
  width: 6%;
  white-space: nowrap;
}

.slow-stock-evidence-table th:nth-child(12),
.slow-stock-evidence-table td:nth-child(12),
.slow-stock-evidence-table th:nth-child(13),
.slow-stock-evidence-table td:nth-child(13) {
  width: 5%;
}

.slow-stock-evidence-table th:nth-child(14),
.slow-stock-evidence-table td:nth-child(14),
.slow-stock-evidence-table th:nth-child(15),
.slow-stock-evidence-table td:nth-child(15),
.slow-stock-evidence-table th:nth-child(16),
.slow-stock-evidence-table td:nth-child(16),
.slow-stock-evidence-table th:nth-child(17),
.slow-stock-evidence-table td:nth-child(17) {
  width: 4%;
}

.slow-stock-evidence-table th:nth-child(18),
.slow-stock-evidence-table td:nth-child(18) {
  width: 8%;
  white-space: normal;
}

.slow-stock-option-modal-card .dashboard-item-chart-shell,
.slow-stock-option-modal-card .slow-stock-order-chart-shell {
  min-height: 320px;
}

.slow-stock-empty {
  text-align: center !important;
  color: #64748b;
  padding: 22px !important;
}

.slow-stock-wrap.is-loading .slow-stock-filter-panel {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table td,
.slow-stock-wrap.slow-stock-compact .slow-stock-table th,
.slow-stock-wrap.slow-stock-compact .slow-stock-option-table td,
.slow-stock-wrap.slow-stock-compact .slow-stock-option-table th {
  padding-top: 6px;
  padding-bottom: 6px;
  padding-left: 3px;
  padding-right: 3px;
  font-size: 0.76rem;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table {
  table-layout: fixed;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th,
.slow-stock-wrap.slow-stock-compact .slow-stock-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table .slow-stock-sort-button {
  gap: 2px;
  padding: 6px 3px;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table thead th:first-child .slow-stock-sort-button {
  gap: 4px;
  padding-inline: 6px;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-sort-icon {
  flex-basis: 9px;
  width: 9px;
  min-width: 9px;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table td:nth-child(9),
.slow-stock-wrap.slow-stock-compact .slow-stock-table td:nth-child(10),
.slow-stock-wrap.slow-stock-compact .slow-stock-table td:nth-child(12) {
  padding-left: 2px;
  padding-right: 2px;
  font-size: 0.72rem;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table td.slow-stock-slow-share {
  padding-left: 2px;
  padding-right: 2px;
  text-align: center;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-product-cell {
  min-width: 0;
  border-left-width: 4px !important;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-product-cell strong,
.slow-stock-wrap.slow-stock-compact .slow-stock-product-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(1) {
  width: 15.8%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(2) {
  width: 4.6%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(3),
.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(4) {
  width: 4%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(5) {
  width: 4.1%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(6) {
  width: 4.2%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(7) {
  width: 3.7%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(8),
.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(13) {
  width: 4.2%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(9) {
  width: 7.6%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(10) {
  width: 7.4%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(11) {
  width: 4.1%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(12),
.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(15) {
  width: 4.8%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(14) {
  width: 3.1%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(16) {
  width: 4.1%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(17) {
  width: 5.1%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-table th:nth-child(18) {
  width: 7.8%;
}

.slow-stock-wrap.slow-stock-compact .slow-stock-zone,
.slow-stock-wrap.slow-stock-compact .slow-stock-confidence {
  min-height: 22px;
  padding: 2px 5px;
}

.kpi-def-list {
  margin: 10px 0 8px;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.kpi-def-list li {
  color: #223758;
  font-size: 0.9rem;
  line-height: 1.5;
}

.cp-page-insight {
  margin-top: 6px;
  font-weight: 600;
  color: #244b82;
}

.cp-mini-kpi-grid {
  margin-top: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cp-ads-page .cp-ads-search-panel {
  width: min(1100px, 100%);
  margin-inline: auto;
}

.cp-ads-chart-box {
  position: relative;
  height: 360px;
  width: 100%;
  margin-top: 10px;
}

.cp-ads-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cp-ads-help {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.cp-ads-help-trigger {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #b9c9e7;
  background: #f5f8ff;
  color: #20416d;
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1;
  cursor: help;
  box-shadow: 0 8px 18px rgba(27, 62, 117, 0.12);
}

.cp-ads-help-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(380px, 72vw);
  padding: 12px 14px;
  border: 1px solid #c7d6ee;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  color: #20344f;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.cp-ads-help-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.cp-ads-help-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 0.81rem;
  line-height: 1.52;
}

.cp-ads-help:hover .cp-ads-help-card,
.cp-ads-help:focus-within .cp-ads-help-card {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cp-ads-chart-metrics {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #d8e3f6;
  border-radius: 12px;
  background: #f7faff;
}

.cp-ads-chart-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d8e3f6;
  border-radius: 12px;
  background: #f7faff;
}

.cp-ads-toolbar-label {
  margin: 0 0 6px;
  color: #16345d;
  font-size: 0.82rem;
  font-weight: 800;
}

.cp-ads-chart-presets,
.cp-ads-chart-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cp-ads-preset-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cp-ads-preset-actions .desc {
  margin: 0;
}

.mk-preset-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mk-trash-btn {
  width: auto;
  min-width: 72px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #cad7ee;
  border-radius: 10px;
  background: #ffffff;
  color: #29476f;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
}

.mk-trash-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mk-trash-btn .trash-emoji {
  font-size: 16px;
  line-height: 1;
}

.cp-ads-preset-chip.saved {
  border-style: dashed;
}

.cp-ads-metric-chip {
  border-color: color-mix(in srgb, var(--metric-color, #cad7ee) 38%, #cad7ee);
}

.cp-ads-metric-chip.active {
  border-color: var(--metric-color, #0d6efd);
  background: var(--metric-color, #0d6efd);
  color: #ffffff;
}

.cp-ads-table-scroll .compare-table {
  min-width: 2380px;
}

.cp-ads-product-filter-scroll .compare-table {
  min-width: 1100px;
}

.cp-ads-product-filter-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid #d8e3f6;
  border-radius: 12px;
  background: #f7faff;
}

.cp-ads-filter-caption {
  color: #16345d;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.cp-ads-product-filter-toolbar .quick-range {
  margin-top: 0;
}

.marketing-imall-page .validation-wrap {
  display: grid;
  gap: 14px;
}

.marketing-crm-page .validation-wrap {
  display: grid;
  gap: 14px;
}

.crm-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.crm-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.crm-query-inline {
  grid-template-columns: minmax(280px, 440px);
  margin-top: 14px;
}

.crm-filter-wrap.hidden {
  display: none;
}

.crm-search-wrap {
  position: relative;
}

.crm-suggest {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 30;
  border: 1px solid #bfcee4;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.14);
  max-height: 250px;
  overflow-y: auto;
}

.crm-suggest-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid #edf2fb;
  background: #ffffff;
  text-align: left;
  padding: 9px 10px;
  color: #1a3359;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.crm-suggest-item:last-child {
  border-bottom: none;
}

.crm-suggest-item:hover {
  background: #eef5ff;
}

.crm-suggest-empty {
  margin: 0;
  padding: 10px;
  font-size: 0.84rem;
  color: #5a6f92;
}

.crm-suggest-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #14335c;
}

.crm-suggest-meta {
  font-size: 0.76rem;
  color: #5a6f92;
}

.crm-query-head {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(191, 211, 246, 0.7);
}

.crm-filter-grid-products {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding-top: 22px;
  color: #28456f;
  font-size: 0.88rem;
  font-weight: 700;
}

.crm-checkline input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.crm-checkline-compact {
  padding-top: 0;
  min-height: 0;
}

.crm-inline-field-compact {
  min-width: 150px;
}

.crm-table-actions {
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.crm-column-mode {
  margin-right: 4px;
}

.crm-compare-presets {
  max-width: 760px;
  justify-content: flex-end;
}

.crm-compare-presets .quick-chip {
  white-space: nowrap;
}

.crm-compare-pill {
  white-space: nowrap;
}

.crm-compare-anchor {
  position: relative;
}

.crm-compare-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(920px, calc(100vw - 72px));
  padding: 18px;
  border: 1px solid #d9e4f6;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 36, 68, 0.18);
}

.crm-compare-popover-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.crm-compare-preset-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.crm-compare-preset-list .quick-chip {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.crm-compare-custom-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.crm-compare-custom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.crm-compare-custom-help {
  margin: 0;
}

.crm-compare-actions {
  display: flex;
  justify-content: flex-end;
}

.crm-selected-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 32px;
  margin-bottom: 12px;
  color: #24466f;
}

.crm-chart-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.crm-chart-metrics.hidden {
  display: none;
}

.crm-selected-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.crm-selected-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: #173761;
  line-height: 1.35;
}

.crm-selected-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.crm-variant-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 0;
}

.crm-variant-chip {
  border: 1px solid #c9d7ee;
  border-radius: 999px;
  background: #ffffff;
  color: #32507d;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.crm-variant-chip:hover {
  background: #eef4ff;
  border-color: #9ebcff;
}

.crm-variant-chip.active {
  background: linear-gradient(180deg, #2578ff 0%, #0d63ef 100%);
  border-color: #0d63ef;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(13, 99, 239, 0.18);
}

.crm-row-clickable {
  cursor: pointer;
}

.crm-row-clickable:hover td {
  background: #f7fbff;
}

.crm-selected-row td {
  background: #eef4ff;
}

.crm-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #123e8d;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-change-text {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  line-height: 1.2;
}

.crm-change-line {
  display: block;
}

.crm-change-text.changed {
  color: #0f6a4a;
  font-weight: 700;
}

.crm-compare-row-up td {
  background: #f3f8ff;
}

.crm-compare-row-down td {
  background: #fff4f4;
}

.crm-compare-delta {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.crm-compare-delta.up {
  background: #eaf3ff;
  color: #1f5fb8;
}

.crm-compare-delta.down {
  background: #ffefef;
  color: #c24141;
}

.crm-compare-delta.flat {
  background: #f3f6fb;
  color: #526987;
}

.crm-value-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
}

.crm-value-badge.good {
  background: linear-gradient(180deg, #eef7ff 0%, #e3f0ff 100%);
  color: #1e5fb9;
  border-color: #cfe0fb;
}

.crm-value-badge.bad {
  background: linear-gradient(180deg, #fff4f5 0%, #ffe9eb 100%);
  color: #c13a4a;
  border-color: #f8cdd3;
}

.crm-value-badge.flat {
  background: #f4f7fb;
  color: #5b6e88;
  border-color: #dde5f1;
}

.crm-alert-card {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  border-width: 1px;
  border-style: solid;
}

.crm-alert-card:hover {
  transform: translateY(-2px);
}

.crm-alert-card.active {
  border-width: 2px;
  transform: translateY(-1px);
}

.crm-alert-channel {
  display: inline-block;
  white-space: nowrap;
  word-break: keep-all;
}

.crm-alert-summary {
  white-space: normal;
  line-height: 1.45;
}

.crm-alert-summary > div + div {
  margin-top: 2px;
}

.crm-empty-text {
  margin: 0;
  color: #5e6f8a;
  font-size: 0.86rem;
}

.crm-table-actions-wrap {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.crm-table-actions-top,
.crm-table-actions-bottom {
  justify-content: flex-end;
}

.crm-campaign-table {
  min-width: 1920px;
  border-collapse: separate;
  border-spacing: 0;
}

.crm-table-scroll-main {
  position: relative;
  cursor: grab;
  scrollbar-gutter: auto;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  border: 1px solid #dbe5f5;
  border-radius: 18px;
  background: #ffffff;
}

.crm-campaign-sticky-head {
  position: fixed;
  z-index: 60;
  overflow: hidden;
  border: 1px solid #dbe5f5;
  border-radius: 18px 18px 0 0;
  background: #f3f7ff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.crm-campaign-sticky-scroll {
  overflow: hidden;
}

.crm-campaign-table-clone {
  border-collapse: separate;
  border-spacing: 0;
}

.crm-table-scroll-main::-webkit-scrollbar {
  height: 12px;
}

.crm-table-scroll-main::-webkit-scrollbar-track {
  background: rgba(220, 230, 246, 0.95);
  border-radius: 999px;
}

.crm-table-scroll-main::-webkit-scrollbar-thumb {
  background: #8ca6cf;
  border-radius: 999px;
  border: 2px solid rgba(220, 230, 246, 0.95);
}

.crm-table-scroll-main.dragging {
  cursor: grabbing;
  user-select: none;
}

.crm-campaign-table thead th {
  position: static;
  background: #f3f7ff;
  box-shadow: 0 8px 14px rgba(15, 23, 42, 0.06);
  white-space: nowrap;
}

.crm-campaign-table-clone thead th {
  position: static;
  background: #f3f7ff;
  box-shadow: none;
  white-space: nowrap;
}

.crm-campaign-table thead th.crm-sortable-head {
  padding: 0;
}

.crm-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 100%;
  padding: 16px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.crm-sort-button:hover {
  background: rgba(37, 99, 235, 0.04);
}

.crm-sort-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: -2px;
  border-radius: 10px;
}

.crm-sort-label {
  display: inline-flex;
  align-items: center;
}

.crm-sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  color: #7b8da8;
  font-size: 0.82rem;
  line-height: 1;
}

.crm-campaign-table thead th[data-sort-state="desc"] .crm-sort-icon,
.crm-campaign-table thead th[data-sort-state="asc"] .crm-sort-icon {
  color: #2563eb;
  font-weight: 900;
}

.crm-campaign-table th,
.crm-campaign-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.crm-campaign-table td:first-child,
.crm-campaign-table-clone th:first-child {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 2;
}

.crm-campaign-table td:first-child,
.crm-campaign-table-clone th:first-child {
  min-width: 320px;
  max-width: 320px;
  box-shadow: 10px 0 14px rgba(15, 23, 42, 0.05);
}

.crm-campaign-table thead th:first-child,
.crm-campaign-table-clone thead th:first-child {
  background: #f3f7ff;
  z-index: 7;
  min-width: 320px;
  max-width: 320px;
  left: 0;
}

.crm-campaign-table th[data-key="cost_per_visit"],
.crm-campaign-table td[data-key="cost_per_visit"],
.crm-campaign-table th[data-key="cost_per_order"],
.crm-campaign-table td[data-key="cost_per_order"] {
  min-width: 108px;
}

.crm-campaign-table th[data-key="last_day"],
.crm-campaign-table td[data-key="last_day"] {
  min-width: 132px;
  max-width: 132px;
}

.crm-campaign-table th[data-key="channel"],
.crm-campaign-table td[data-key="channel"] {
  min-width: 112px;
}

.crm-campaign-table th[data-key="ad_cost"],
.crm-campaign-table td[data-key="ad_cost"] {
  min-width: 108px;
}

.crm-campaign-table th[data-key="change_summary"],
.crm-campaign-table td[data-key="change_summary"] {
  min-width: 188px;
  max-width: 188px;
}

.crm-campaign-table th[data-key="cvr"],
.crm-campaign-table td[data-key="cvr"] {
  min-width: 88px;
}

.crm-campaign-table th[data-key="cost_per_visit"],
.crm-campaign-table th[data-key="cost_per_order"],
.crm-campaign-table th[data-key="cvr"] {
  font-size: 0.82rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.crm-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.crm-compare-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.crm-compare-meta-card {
  display: grid;
  gap: 4px;
  border: 1px solid #d8e3f6;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fbff;
}

.crm-compare-meta-label {
  color: #5f7392;
  font-size: 0.76rem;
  font-weight: 800;
}

.crm-compare-meta-value {
  color: #173761;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.4;
}

.crm-cost-cell {
  display: grid;
  gap: 4px;
  align-content: start;
}

.crm-cost-value {
  color: #16355e;
  font-size: 0.94rem;
  font-weight: 800;
}

.crm-cost-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  inline-size: max-content;
  max-width: none;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 10px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid #d4deef;
  background: #f4f7fc;
  color: #355275;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  word-break: keep-all;
}

.crm-cost-badge.actual {
  background: #edf9f3;
  border-color: #b7e4cb;
  color: #0f7a4a;
}

.crm-cost-badge.all-options {
  background: #edf4ff;
  border-color: #bfd2ff;
  color: #2456b8;
}

.crm-cost-badge.weighted-average {
  background: #edf8f4;
  border-color: #bfe2d2;
  color: #18794e;
}

.crm-cost-badge.composite {
  background: #f3f0ff;
  border-color: #d7cafb;
  color: #5f3dc4;
}

.crm-cost-badge.fixed-cost {
  background: #fff4e8;
  border-color: #f3cf9f;
  color: #a95b00;
}

.crm-cost-badge.estimated {
  background: #eef4ff;
  border-color: #c7d8fb;
  color: #2f5bb8;
}

.crm-cost-badge.missing {
  background: #fff5e8;
  border-color: #f3d2a6;
  color: #a55a05;
}

.crm-cost-caption {
  color: #607491;
  font-size: 0.76rem;
  line-height: 1.35;
}

.crm-cost-modal-card {
  width: min(960px, calc(100vw - 28px));
}

.crm-cost-modal-grid {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.crm-cost-modal-section {
  display: grid;
  gap: 12px;
  align-content: start;
  align-self: start;
}

.crm-cost-modal-section h3 {
  margin: 0;
  color: #16355e;
  font-size: 0.98rem;
}

.crm-cost-current-box,
.crm-cost-selected-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #dbe6f7;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.crm-cost-strategy-box {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dbe6f7;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.crm-cost-strategy-summary {
  display: grid;
  gap: 5px;
}

.crm-cost-strategy-summary strong {
  color: #16355e;
  font-size: 0.98rem;
}

.crm-cost-strategy-summary span {
  color: #607491;
  font-size: 0.82rem;
}

.crm-cost-strategy-list {
  display: grid;
  gap: 12px;
}

.crm-cost-strategy-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid #d7e2f2;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.crm-cost-strategy-item:hover {
  border-color: #adc9ff;
  box-shadow: 0 10px 24px rgba(41, 78, 145, 0.08);
  transform: translateY(-1px);
}

.crm-cost-strategy-item.active {
  border-color: #7aa7ff;
  background: #f2f7ff;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12), 0 12px 24px rgba(59, 130, 246, 0.1);
}

.crm-cost-strategy-copy {
  display: grid;
  gap: 4px;
}

.crm-cost-strategy-copy strong {
  color: #16355e;
  font-size: 0.92rem;
}

.crm-cost-strategy-copy span {
  color: #607491;
  font-size: 0.8rem;
  line-height: 1.4;
}

.crm-cost-strategy-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #4c6487;
}

.crm-cost-option-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f3f7ff;
  border: 1px solid #d8e4f7;
  color: #315277;
  font-size: 0.76rem;
  line-height: 1.2;
  white-space: nowrap;
}

.crm-cost-manual-field {
  margin-top: 4px;
}

.crm-cost-manual-field input {
  max-width: 220px;
}

.crm-cost-option-tag em {
  font-style: normal;
  color: #617696;
  font-weight: 700;
}

.crm-cost-item-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #dbe6f7;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.crm-cost-item-main {
  display: grid;
  gap: 8px;
}

.crm-cost-item-title {
  color: #16355e;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.45;
}

.crm-cost-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-cost-item-summary {
  display: grid;
  gap: 4px;
}

.crm-cost-item-summary strong {
  color: #16355e;
  font-size: 0.92rem;
}

.crm-cost-item-summary span {
  color: #607491;
  font-size: 0.8rem;
}

.crm-cost-item-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-cost-item-breakdown {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.crm-cost-item-breakdown-group {
  padding: 10px 12px;
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.92);
}

.crm-cost-item-breakdown-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  color: #16355e;
}

.crm-cost-item-breakdown-head span {
  color: #607491;
  font-size: 0.78rem;
}

.crm-cost-item-breakdown-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-cost-item-actions {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.crm-cost-share-field {
  min-width: 150px;
}

.crm-cost-share-field input {
  max-width: 120px;
}

.crm-cost-modal-card .mk-modal-actions .btn {
  white-space: nowrap;
}

.crm-cost-clear-btn {
  background: #fff3ef;
  border: 1px solid #efc0b7;
  color: #a54634;
  box-shadow: 0 8px 18px rgba(202, 102, 79, 0.08);
}

.crm-cost-clear-btn:hover,
.crm-cost-clear-btn:focus-visible {
  background: #ffe7e0;
  border-color: #e59c8d;
  color: #8d3729;
}

.crm-cost-current-box strong,
.crm-cost-selected-box strong {
  color: #16355e;
  font-size: 1rem;
}

.crm-cost-preview-title {
  color: #16355e;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.45;
}

.crm-cost-preview-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-cost-preview-pill,
.crm-cost-preview-strategy {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #d7e2f2;
  background: #ffffff;
  color: #365276;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.crm-cost-preview-strategy {
  width: max-content;
  max-width: 100%;
  white-space: normal;
  border-color: #bfd3ff;
  background: #eef5ff;
  color: #1f55ad;
}

.crm-cost-current-status {
  display: grid;
  gap: 6px;
}

.crm-cost-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.crm-cost-apply-btn {
  min-width: 104px;
  align-self: stretch;
}

.crm-cost-modal-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.crm-cost-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.crm-cost-overview-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #d7e2f2;
  border-radius: 14px;
  background: #ffffff;
}

.crm-cost-overview-card span {
  color: #607491;
  font-size: 0.78rem;
  font-weight: 700;
}

.crm-cost-overview-card strong {
  color: #16355e;
  font-size: 1rem;
  font-weight: 800;
}

.crm-cost-group-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-cost-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d8e4f7;
  background: #ffffff;
  color: #3c587f;
  font-size: 0.78rem;
  font-weight: 700;
}

.crm-cost-group-chip strong {
  color: #16355e;
  font-size: 0.84rem;
}

.crm-cost-group-chip span {
  color: #607491;
}

.crm-cost-options-table-wrap {
  border: 1px solid #dbe6f7;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.crm-cost-options-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.crm-cost-options-table th,
.crm-cost-options-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e7eef9;
  vertical-align: top;
}

.crm-cost-options-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f9ff;
  color: #34527c;
  font-size: 0.78rem;
  font-weight: 800;
}

.crm-cost-options-table tbody tr:last-child td {
  border-bottom: none;
}

.crm-cost-option-main {
  color: #173761;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
  word-break: keep-all;
}

.crm-cost-option-sub {
  margin-top: 4px;
  color: #7185a4;
  font-size: 0.76rem;
  line-height: 1.35;
  word-break: break-all;
}

.crm-cost-table-num {
  color: #16355e;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.crm-cost-recommend {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: #e8f7ef;
  color: #0f7a4a;
  font-size: 0.7rem;
  font-weight: 800;
  vertical-align: middle;
}

@media (max-width: 980px) {
  .crm-compare-popover {
    width: min(100vw - 32px, 720px);
  }

  .crm-compare-popover-grid {
    grid-template-columns: 1fr;
  }

  .crm-compare-preset-list {
    max-height: none;
    overflow: visible;
  }

  .crm-compare-custom-grid {
    grid-template-columns: 1fr;
  }

  .crm-cost-modal-grid,
  .crm-cost-modal-field-grid {
    grid-template-columns: 1fr;
  }

  .crm-cost-overview-grid {
    grid-template-columns: 1fr;
  }

  .itsus-cost-modal-card {
    width: min(calc(100vw - 16px), 980px);
    padding: 18px;
    border-radius: 20px;
  }

  .itsus-cost-modal-card .mk-modal-head {
    gap: 12px;
  }

  .itsus-cost-modal-card .crm-cost-overview-grid,
  .itsus-cost-modal-card .crm-cost-strategy-list {
    grid-template-columns: 1fr;
  }
}

.crm-compare-panel {
  display: grid;
  gap: 10px;
}

.crm-compare-panel h3 {
  margin: 0;
  color: #16355e;
  font-size: 0.95rem;
}

.cards-compact {
  margin-bottom: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.mk-imall-range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 12px;
  margin-bottom: 10px;
}

.mk-imall-groupby-wrap {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.mk-inline-caption {
  font-size: 0.78rem;
  font-weight: 800;
  color: #36537d;
}

.mk-imall-chart-metrics {
  margin-bottom: 10px;
}

.mk-inline-field {
  display: grid;
  gap: 6px;
}

.mk-inline-field span {
  font-size: 0.83rem;
  font-weight: 700;
  color: #2c456d;
}

.mk-inline-field input {
  height: 40px;
  border: 1px solid #c4d1e5;
  border-radius: 9px;
  padding: 0 10px;
  background: #ffffff;
}

.mk-imall-delay-note {
  margin-top: 10px;
  color: #8a5000;
  font-weight: 600;
}

.mk-preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cp-ads-preset-bar {
  margin-bottom: 10px;
}

.mk-metric-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #cad7ee;
  border-radius: 999px;
  background: #ffffff;
  color: #2b4a77;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 12px;
}

.mk-metric-toggle-chip:hover {
  background: #f5f9ff;
}

.mk-metric-toggle-chip.active {
  border-color: var(--metric-color, #0d6efd);
  background: color-mix(in srgb, var(--metric-color, #0d6efd) 14%, #ffffff);
  color: #123d88;
}

.mk-metric-toggle-chip.inactive {
  opacity: 0.58;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.mk-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 10px;
}

.mk-preset-chip.saved {
  border-style: dashed;
}

.mk-legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.mk-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f4f8ff;
  border: 1px solid #d7e3f7;
  color: #26436c;
  font-size: 0.8rem;
  font-weight: 700;
}

.mk-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.mk-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(2px);
}

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

.mk-modal-card {
  width: min(840px, calc(100vw - 28px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid #d8e3f6;
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.24);
  display: grid;
  gap: 14px;
}

.mk-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mk-metric-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mk-metric-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid #d7e3f7;
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
}

.mk-metric-option strong {
  display: block;
  color: #16345d;
  margin-bottom: 4px;
}

.mk-metric-option small {
  color: #637794;
  line-height: 1.45;
}

.mk-color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.fb-page-wrap {
  gap: 16px;
}

.fb-product-table tbody tr {
  cursor: default;
}

.fb-product-table tbody tr.active {
  background: #eef5ff;
}

.fb-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  border: 1px solid #d9e3f3;
  border-radius: 16px;
  background: #ffffff;
  position: relative;
  scrollbar-gutter: stable;
}

.fb-table-scroll .compare-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.fb-product-table {
  width: auto;
  min-width: 0;
  table-layout: fixed;
}

.fb-product-table-clone {
  width: auto;
  min-width: 0;
  table-layout: fixed;
}

.fb-variant-table,
.fb-raw-table {
  min-width: 1960px;
}

.fb-table-scroll .compare-table th,
.fb-table-scroll .compare-table td {
  white-space: nowrap;
  background: #ffffff;
}

.fb-product-table-scroll-main {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
  cursor: grab;
  overscroll-behavior-x: contain;
  scrollbar-gutter: auto;
  border: 1px solid #dbe5f5;
  border-radius: 18px;
  background: #ffffff;
}

.fb-product-table-scroll-main.dragging {
  cursor: grabbing;
  user-select: none;
}

.fb-product-sticky-head {
  position: fixed;
  z-index: 60;
  overflow: hidden;
  border: 1px solid #dbe5f5;
  border-radius: 18px 18px 0 0;
  background: #f3f7ff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.fb-product-sticky-scroll {
  overflow: hidden;
}

.fb-product-table-clone {
  border-collapse: separate;
  border-spacing: 0;
}

.fb-product-table-scroll-main::-webkit-scrollbar {
  height: 12px;
}

.fb-product-table-scroll-main::-webkit-scrollbar-track {
  background: rgba(220, 230, 246, 0.95);
  border-radius: 999px;
}

.fb-product-table-scroll-main::-webkit-scrollbar-thumb {
  background: #8ca6cf;
  border-radius: 999px;
  border: 2px solid rgba(220, 230, 246, 0.95);
}

.fb-product-table thead th {
  position: static;
  background: #f3f7ff;
  white-space: nowrap;
  vertical-align: middle;
  box-shadow: 0 8px 14px rgba(15, 23, 42, 0.06);
  background-clip: padding-box;
}

.fb-product-table-clone thead th {
  position: static;
  background: #f3f7ff;
  box-shadow: none;
  white-space: nowrap;
  background-clip: padding-box;
  box-sizing: border-box;
}

.fb-product-table th[data-column-key="product_name"],
.fb-product-table td[data-column-key="product_name"],
.fb-product-table-clone th[data-column-key="product_name"] {
  position: sticky;
  left: 0;
  min-width: 320px;
  max-width: 320px;
  white-space: normal;
  background: #ffffff;
  box-shadow: inset -1px 0 0 #d9e5f8, 8px 0 18px rgba(15, 23, 42, 0.05);
  background-clip: padding-box;
  z-index: 2;
}

.fb-product-table thead th[data-column-key="product_name"],
.fb-product-table-clone thead th[data-column-key="product_name"] {
  position: sticky;
  left: 0;
  background: #f3f7ff;
  z-index: 24;
  box-shadow: inset -1px 0 0 #d9e5f8, 8px 0 18px rgba(15, 23, 42, 0.05);
}

.fb-product-table tbody td[data-column-key="product_name"] {
  z-index: 3;
}

.fb-product-table tbody tr.active td[data-column-key="product_name"] {
  background: #eef5ff;
}

.fb-product-table tbody tr:hover td[data-column-key="product_name"] {
  background: #f7fbff;
}

.fb-product-table th[data-column-key="ad_cost"],
.fb-product-table td[data-column-key="ad_cost"],
.fb-product-table-clone th[data-column-key="ad_cost"] { min-width: 112px; max-width: 112px; }
.fb-product-table th[data-column-key="purchases"],
.fb-product-table td[data-column-key="purchases"],
.fb-product-table-clone th[data-column-key="purchases"] { min-width: 96px; max-width: 96px; }
.fb-product-table th[data-column-key="revenue"],
.fb-product-table td[data-column-key="revenue"],
.fb-product-table-clone th[data-column-key="revenue"] { min-width: 148px; max-width: 148px; }
.fb-product-table th[data-column-key="cpm"],
.fb-product-table td[data-column-key="cpm"],
.fb-product-table-clone th[data-column-key="cpm"] { min-width: 108px; max-width: 108px; }
.fb-product-table th[data-column-key="ctr"],
.fb-product-table td[data-column-key="ctr"],
.fb-product-table-clone th[data-column-key="ctr"] { min-width: 102px; max-width: 102px; }
.fb-product-table th[data-column-key="cpc"],
.fb-product-table td[data-column-key="cpc"],
.fb-product-table-clone th[data-column-key="cpc"] { min-width: 112px; max-width: 112px; }
.fb-product-table th[data-column-key="content_views"],
.fb-product-table td[data-column-key="content_views"],
.fb-product-table-clone th[data-column-key="content_views"] { min-width: 122px; max-width: 122px; }
.fb-product-table th[data-column-key="landing_page_view_ctr"],
.fb-product-table td[data-column-key="landing_page_view_ctr"],
.fb-product-table-clone th[data-column-key="landing_page_view_ctr"] { min-width: 126px; max-width: 126px; }
.fb-product-table th[data-column-key="cost_per_content_view"],
.fb-product-table td[data-column-key="cost_per_content_view"],
.fb-product-table-clone th[data-column-key="cost_per_content_view"] { min-width: 150px; max-width: 150px; }
.fb-product-table th[data-column-key="impressions"],
.fb-product-table td[data-column-key="impressions"],
.fb-product-table-clone th[data-column-key="impressions"] { min-width: 120px; max-width: 120px; }
.fb-product-table th[data-column-key="clicks"],
.fb-product-table td[data-column-key="clicks"],
.fb-product-table-clone th[data-column-key="clicks"] { min-width: 102px; max-width: 102px; }
.fb-product-table th[data-column-key="profit"],
.fb-product-table td[data-column-key="profit"],
.fb-product-table-clone th[data-column-key="profit"] { min-width: 138px; max-width: 138px; }
.fb-product-table th[data-column-key="profit_margin"],
.fb-product-table td[data-column-key="profit_margin"],
.fb-product-table-clone th[data-column-key="profit_margin"] { min-width: 112px; max-width: 112px; }
.fb-product-table th[data-column-key="roas"],
.fb-product-table td[data-column-key="roas"],
.fb-product-table-clone th[data-column-key="roas"] { min-width: 102px; max-width: 102px; }
.fb-product-table th[data-column-key="product_cost"],
.fb-product-table td[data-column-key="product_cost"],
.fb-product-table-clone th[data-column-key="product_cost"] { min-width: 420px; max-width: 420px; }

.fb-table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f3f7ff;
  background-clip: padding-box;
}

.fb-variant-table th:first-child,
.fb-variant-table td:first-child,
.fb-raw-table th:first-child,
.fb-raw-table td:first-child {
  min-width: 300px;
  max-width: 300px;
  white-space: normal;
}

.fb-product-name {
  color: #16345d;
  font-weight: 800;
  line-height: 1.45;
}

.fb-product-cell-clickable {
  cursor: pointer;
}

.fb-product-cell-clickable:hover {
  background: #f7fbff;
}

.fb-cost-meta-line {
  color: #4f6486;
  font-size: 0.82rem;
  line-height: 1.45;
}

.fb-product-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: #6b7d99;
  font-size: 0.76rem;
  font-weight: 700;
}

.fb-cost-cell-td {
  min-width: 420px;
}

.fb-cost-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
}

.fb-cost-trigger:hover .crm-cost-badge,
.fb-cost-trigger:focus-visible .crm-cost-badge {
  border-color: #8eb1f0;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.fb-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.fb-detail-preset-panel {
  margin-bottom: 12px;
}

.fb-detail-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #d9e5f8;
  border-radius: 12px;
  background: #f8fbff;
}

.fb-detail-card strong {
  color: #466287;
  font-size: 0.78rem;
}

.fb-detail-card span {
  color: #16345d;
  font-size: 1rem;
  font-weight: 800;
}

.fb-variant-chip-row {
  margin-bottom: 12px;
}

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

.fb-detail-chip-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.fb-detail-chip-group-right {
  flex: 0 1 46%;
}

.fb-campaign-chip-row {
  justify-content: flex-end;
}

.fb-detail-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0 12px;
}

.fb-detail-pane.hidden {
  display: none;
}

.fb-variant-table tbody tr.active,
.fb-raw-table tbody tr.active {
  background: #eef5ff;
}

.fb-variant-table tbody tr.active > td,
.fb-raw-table tbody tr.active > td {
  background: #eef5ff;
}

@media (max-width: 1200px) {
  .fb-detail-chip-head {
    flex-direction: column;
  }

  .fb-detail-chip-group-right {
    flex-basis: auto;
  }

  .fb-campaign-chip-row {
    justify-content: flex-start;
  }
}

.fb-sort-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 54px;
  padding: 14px 16px;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.fb-sort-btn.active {
  color: #2563eb;
}

.fb-sort-indicator {
  color: #6b7d99;
  font-size: 0.72rem;
  line-height: 1;
  flex: 0 0 auto;
}

.fb-sort-btn .label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.crm-cost-badge.simple-average {
  background: #edf4ff;
  border-color: #bfd2ff;
  color: #2456b8;
}

.fb-cost-modal-card {
  width: min(980px, calc(100vw - 28px));
}

.fb-cost-current-box {
  min-height: 92px;
}

.fb-cost-current-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fb-cost-current-inline strong {
  color: #16355e;
  font-size: 0.96rem;
}

.fb-cost-search-wrap {
  margin-bottom: 12px;
}

.fb-cost-search-wrap .mk-inline-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.fb-cost-manual-wrap {
  border-top: 1px solid #dbe6f7;
  padding-top: 12px;
}

.fb-cost-option-empty {
  color: #607491;
  text-align: center;
  padding: 16px 12px;
}

.itsus-cost-modal-card {
  width: min(1060px, calc(100vw - 24px));
  padding: 22px;
  gap: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.itsus-cost-modal-card .mk-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #dde8f8;
}

.itsus-cost-modal-card .mk-modal-head h2 {
  margin: 0;
  color: #16355e;
  font-size: 1.15rem;
}

.itsus-cost-modal-card .mk-modal-head p {
  margin-top: 6px;
  max-width: 560px;
  color: #607491;
  line-height: 1.5;
}

.itsus-cost-current-box {
  min-height: 120px;
}

.itsus-cost-meta-box {
  min-height: 120px;
  border-style: dashed;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.itsus-cost-preview-pills {
  margin-top: 2px;
}

.itsus-cost-overview-card {
  min-height: 96px;
  align-content: start;
}

.itsus-cost-modal-card .crm-cost-overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.itsus-cost-modal-card .crm-cost-strategy-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.itsus-cost-modal-card .crm-cost-strategy-item {
  min-height: 100%;
}

.itsus-cost-modal-card .crm-cost-options-table-wrap {
  max-height: 340px;
  overflow: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.itsus-cost-modal-card .crm-cost-options-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.itsus-cost-modal-card .crm-cost-options-table tbody tr:hover td {
  background: #f3f8ff;
}

.itsus-cost-modal-card .crm-cost-options-table td:nth-child(3),
.itsus-cost-modal-card .crm-cost-options-table td:nth-child(4) {
  text-align: right;
}

.itsus-cost-modal-card .mk-modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(247, 251, 255, 0), #f7fbff 32%, #f7fbff 100%);
}

.itsus-cost-modal-status {
  padding: 12px 14px;
  border: 1px solid #dbe6f7;
  border-radius: 14px;
  background: #f5f9ff;
  color: #4b6385;
  font-size: 0.84rem;
  line-height: 1.45;
}

.itsus-cost-modal-status.warning {
  background: #fff4e8;
  border-color: #f0c89a;
  color: #a65a00;
}

.mk-color-swatch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.mk-color-swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mk-color-swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.mk-color-swatch input:checked + .mk-color-swatch-dot {
  transform: scale(1.1);
  border-color: #16345d;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.cp-ads-table-scroll .compare-table th:first-child,
.cp-ads-table-scroll .compare-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  box-shadow: 8px 0 14px rgba(15, 23, 42, 0.06);
}

.cp-ads-table-scroll .compare-table thead th:first-child {
  z-index: 2;
  background: #f3f7ff;
}

.quick-range {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.quick-chip {
  border: 1px solid #cad7ee;
  border-radius: 999px;
  background: #f4f8ff;
  color: #2b4a77;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}

.quick-chip:hover {
  background: #e9f1ff;
}

.quick-chip.active {
  border-color: #3b82f6;
  background: #0d6efd;
  color: #ffffff;
}

.cp-ads-metric-chip.active {
  border-color: var(--metric-color, #0d6efd);
  background: var(--metric-color, #0d6efd);
  color: #ffffff;
}

.panel.compact {
  padding-top: 10px;
  padding-bottom: 10px;
}

.panel.panel-compact {
  width: min(1100px, 100%);
  margin-inline: auto;
}

.content.content-wide-stack > .session-banner,
.content.content-wide-stack > .global-notice-banner,
.content.content-wide-stack > .page-head,
.content.content-wide-stack > .cards,
.content.content-wide-stack > .panel {
  width: min(1500px, 100%);
  max-width: 100%;
  margin-inline: auto;
}

.table-badge {
  display: inline-block;
  min-width: 68px;
  text-align: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.table-badge.good {
  background: #e9f8ef;
  color: #0f6a4a;
}

.table-badge.warn {
  background: #fff5e2;
  color: #915300;
}

.table-badge.bad {
  background: #ffecee;
  color: #9f1d35;
}

.table-badge.muted {
  background: #eef2f7;
  color: #58677d;
}

.cp-ads-dimension {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.cp-ads-dimension strong {
  font-weight: 800;
}

.cp-ads-dimension span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.table-row-alert td {
  background: #fff7f8;
}

.table-row-watch td {
  background: #fffaf0;
}

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

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

@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .topbar {
    padding-inline: 12px;
  }

  .topbar-left,
  .topbar-right {
    gap: 7px;
  }

  .topbar-session {
    gap: 6px;
    padding: 3px 4px 3px 9px;
  }

  .topbar-session-text {
    font-size: 0.76rem;
  }

  .topbar-session-extend {
    padding-inline: 8px;
  }

  .topbar-right .topbar-user {
    display: none;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 240px;
    height: calc(100vh - 60px);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 18;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .content {
    position: relative;
  }

  .app-shell.sidebar-open .content::before {
    content: "";
    position: fixed;
    top: 60px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 60px);
    background: rgba(15, 23, 42, 0.35);
    z-index: 17;
  }

  .session-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .session-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .login-shell {
    grid-template-columns: 1fr;
    padding: 24px 0;
    min-height: auto;
  }

  .global-notice-banner {
    top: 72px;
    align-items: flex-start;
  }

  .po-form-grid {
    grid-template-columns: 1fr;
  }

  .slow-stock-primary-filters,
  .slow-stock-view-tools,
  .slow-stock-chart-grid,
  .slow-stock-okr-controls,
  .slow-stock-okr-summary {
    grid-template-columns: 1fr;
  }

  .slow-stock-okr-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .slow-stock-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slow-stock-change-kpi {
    grid-column: 1 / -1;
  }

  .slow-stock-filter-panel {
    position: static;
  }

  .slow-stock-filter-head {
    align-items: flex-start;
  }

  .slow-stock-filter-meta {
    flex-wrap: wrap;
    white-space: normal;
  }

  .slow-stock-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .slow-stock-head-actions,
  .slow-stock-detail-actions {
    justify-content: flex-start;
  }

  .validation-wrap-wide {
    width: min(1100px, 92vw);
  }
}

@media (max-width: 620px) {
  .topbar-right .pill {
    display: none;
  }

  .topbar-session-text {
    max-width: 116px;
    overflow: hidden;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .cp-kpi-main {
    font-size: 1.72rem;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cp-mini-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .po-date-grid,
  .po-seller-check-grid {
    grid-template-columns: 1fr;
  }

  .slow-stock-kpis {
    grid-template-columns: 1fr;
  }

  .slow-stock-change-lines {
    grid-template-columns: 1fr;
  }

  .slow-stock-change-details {
    grid-template-columns: 1fr;
  }

  .slow-stock-change-modal-tools {
    grid-template-columns: 1fr;
  }

  .slow-stock-change-modal-tools strong {
    text-align: left;
  }

  .slow-stock-filter-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .slow-stock-map-body {
    height: 560px;
  }

  .slow-stock-filter-grid input,
  .slow-stock-filter-grid select,
  .slow-stock-actions .btn,
  .slow-stock-segmented,
  .slow-stock-head-actions .btn,
  .slow-stock-detail-actions .btn,
  .slow-stock-detail-actions .btn.secondary {
    width: 100%;
  }

  .slow-stock-segmented {
    height: auto;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .slow-stock-segmented button {
    min-height: 34px;
  }

  .slow-stock-check-label {
    padding: 0;
  }

  .mk-imall-range-grid,
  .mk-metric-checklist {
    grid-template-columns: 1fr;
  }

  .crm-filter-grid {
    grid-template-columns: 1fr;
  }

  .crm-compare-grid {
    grid-template-columns: 1fr;
  }

  .crm-checkline {
    padding-top: 0;
  }

  .mk-imall-groupby-wrap {
    justify-items: stretch;
    width: 100%;
  }

  .brand-wordmark-text {
    font-size: 0.9rem;
    letter-spacing: 0.24em;
  }
}

.cost-dashboard-page .content.content-wide-stack > .cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-cost-card {
  min-height: 112px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 255, 0.94));
}

.dashboard-query-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.dashboard-query-submit {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.dashboard-rank-stack {
  width: min(1500px, 100%);
  max-width: 100%;
  margin-inline: auto;
  display: grid;
  gap: 16px;
}

.dashboard-chart-shell {
  position: relative;
}

.dashboard-chart-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(191, 208, 234, 0.56);
  background: rgba(244, 248, 255, 0.78);
  backdrop-filter: blur(3.4px);
  -webkit-backdrop-filter: blur(3.4px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  color: #21426d;
  text-align: center;
  pointer-events: none;
}

.dashboard-chart-loading-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border: 1px solid rgba(191, 208, 234, 0.96);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.11);
  max-width: min(92%, 520px);
}

.dashboard-chart-loading strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.dashboard-chart-loading span {
  display: block;
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.83rem;
  color: #587192;
  line-height: 1.35;
}

.dashboard-chart-loading.hidden {
  display: none !important;
}

.dashboard-rank-pager {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-rank-page-chip {
  border: 1px solid #c8d7f1;
  border-radius: 999px;
  background: #f4f8ff;
  color: #2c4e7f;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 12px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(41, 78, 145, 0.06);
}

.dashboard-rank-page-chip:hover {
  background: #edf4ff;
}

.dashboard-rank-page-chip.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.22);
}

.dashboard-rank-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-rank-card {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid #dbe5f6;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.94));
  padding: 14px 14px 16px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-rank-card:hover {
  transform: translateY(-2px);
  border-color: #bfd3f7;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.12);
}

.dashboard-rank-card-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f1f5fb;
  color: #5e7394;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-rank-card-image-wrap {
  display: grid;
  place-items: center;
}

.dashboard-rank-card-image,
.dashboard-rank-card-image.placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: #edf3ff;
  object-fit: cover;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.dashboard-rank-card-image.placeholder {
  display: grid;
  place-items: center;
  color: #5b7090;
  font-size: 1.3rem;
  font-weight: 800;
}

.dashboard-rank-card-title {
  color: #122b55;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.46;
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dashboard-rank-card-subtitle {
  margin: 0;
  color: #617694;
  font-size: 0.82rem;
  line-height: 1.4;
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dashboard-rank-card-code {
  margin: -2px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #dde7f7;
  border-radius: 999px;
  background: #f8fbff;
  padding: 6px 10px;
  font-size: 0.78rem;
  line-height: 1.2;
}

.dashboard-rank-card-code em {
  color: #607594;
  font-style: normal;
  font-weight: 700;
}

.dashboard-rank-card-code strong {
  color: #153870;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-rank-card-metrics {
  display: grid;
  gap: 6px;
  margin-top: auto;
}

.dashboard-rank-card-metrics span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #d8e4f7;
  border-radius: 999px;
  background: #f7fbff;
  padding: 6px 10px;
}

.dashboard-rank-card-metrics em {
  color: #4f678c;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
}

.dashboard-rank-card-metrics strong {
  color: #184089;
  font-size: 0.84rem;
  font-weight: 800;
}

.dashboard-rank-scroll {
  max-height: 560px;
}

.dashboard-rank-table th,
.dashboard-rank-table td {
  vertical-align: top;
}

.dashboard-rank-action {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.dashboard-rank-action strong {
  font-size: 0.95rem;
  color: #0f2354;
}

.dashboard-rank-action span {
  color: var(--text-subtle);
  font-size: 0.82rem;
}

.dashboard-rank-row:hover {
  background: rgba(37, 99, 235, 0.04);
}

.dashboard-item-modal-card {
  width: min(1160px, calc(100vw - 28px));
}

.dashboard-item-query-panel {
  margin-top: 0;
}

.dashboard-item-media-panel {
  margin-top: 0;
}

.dashboard-item-media-wrap {
  display: grid;
  gap: 14px;
}

.dashboard-media-preview-card {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 16px;
  border: 1px solid #dbe6f7;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.dashboard-media-preview-asset {
  display: grid;
  place-items: center;
}

.dashboard-media-preview-asset img {
  width: 100%;
  max-height: 220px;
  border-radius: 14px;
  object-fit: contain;
  background: #eff4ff;
}

.dashboard-media-preview-copy {
  display: grid;
  align-content: start;
  gap: 10px;
}

.dashboard-media-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid #c6d6f2;
  border-radius: 999px;
  background: #ffffff;
  color: #17408a;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 12px;
}

.dashboard-media-note {
  margin: 0;
  color: #5d7190;
  font-size: 0.88rem;
  line-height: 1.55;
}

.dashboard-media-form {
  display: grid;
  gap: 12px;
  border: 1px solid #dbe6f7;
  border-radius: 16px;
  padding: 14px;
  background: #f8fbff;
}

#dashboardCostChart,
#dashboardItemChart {
  max-height: 460px;
}

@media (max-width: 1100px) {
  .cost-dashboard-page .content.content-wide-stack > .cards,
  .dashboard-rank-stack {
    grid-template-columns: 1fr;
  }

  .dashboard-query-actions {
    align-items: stretch;
  }

  .dashboard-query-submit {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .dashboard-rank-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-media-preview-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-rank-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .dashboard-rank-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ITSUS' MAP */
.itsus-map-page {
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 22%),
    linear-gradient(180deg, #f3f7fb 0%, #edf4fb 24%, #f6f9fc 100%);
}

.itsus-map-shell {
  gap: 22px;
}

.itsus-map-page .content.content-wide-stack {
  padding-top: 18px;
  padding-bottom: 36px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.itsus-map-page .content.content-wide-stack > .session-banner,
.itsus-map-page .content.content-wide-stack > .global-notice-banner,
.itsus-map-page .content.content-wide-stack > .page-head,
.itsus-map-page .content.content-wide-stack > .cards,
.itsus-map-page .content.content-wide-stack > .panel {
  width: min(1680px, 100%);
  min-width: 0;
  max-width: 100%;
}

.itsus-page-head {
  display: block;
  position: static;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.itsus-page-head::after {
  display: none;
}

.itsus-page-head .eyebrow {
  display: block;
}

.itsus-page-head h1 {
  color: inherit;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.itsus-page-head .desc {
  margin: 0;
}

#itsusPageSubtitle {
  max-width: 900px;
}

#itsusSnapshotMeta {
  display: block;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-subtle);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.5;
}

.itsus-filter-panel {
  margin-top: 0;
  border-radius: 26px;
  padding: 20px 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(247, 250, 255, 0.98) 100%);
  box-shadow:
    0 22px 40px rgba(18, 43, 85, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.itsus-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.itsus-map-page .panel {
  border-radius: 16px;
  border-color: #d9e3f3;
  background: #ffffff;
  box-shadow: none;
}

.itsus-map-page .panel-head {
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: 0;
}

.itsus-map-page .panel-head h2 {
  font-size: 1rem;
  font-weight: 700;
  color: inherit;
  letter-spacing: 0;
}

.itsus-map-page .panel-head p {
  color: var(--text-subtle);
  font-size: 0.92rem;
  line-height: 1.5;
}

.itsus-filter-panel .btn.secondary {
  background: linear-gradient(135deg, #174a8b 0%, #2b6cb0 100%);
  box-shadow: 0 14px 26px rgba(25, 74, 139, 0.22);
}

.itsus-filter-panel .btn.secondary:hover {
  filter: brightness(1.02);
}

.itsus-filter-panel .btn.ghost {
  background: rgba(16, 41, 84, 0.06);
  border: 1px solid rgba(187, 203, 226, 0.95);
  color: #244671;
}

.itsus-map-page .mk-inline-field span {
  color: #4c6588;
  font-weight: 800;
}

.itsus-map-page .mk-inline-field input,
.itsus-map-page .mk-inline-field select,
.itsus-map-page .compare-table select {
  border-radius: 14px;
  border-color: #d7e2f3;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.itsus-map-page .mk-inline-field input:focus,
.itsus-map-page .mk-inline-field select:focus,
.itsus-map-page .compare-table select:focus {
  border-color: #5aa4df;
  box-shadow: 0 0 0 4px rgba(90, 164, 223, 0.15);
}

.itsus-table-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.itsus-table-footer {
  margin-top: 12px;
}

.itsus-pager-meta {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  color: #6b7f9b;
  font-size: 0.84rem;
  font-weight: 700;
}

.itsus-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(150px, 0.8fr));
  gap: 12px;
}

.itsus-filter-field-compact {
  max-width: 360px;
}

.itsus-ad-channel-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid #dbe5f5;
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 32%),
    linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.itsus-ad-channel-copy {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.itsus-ad-channel-copy span {
  color: #14315e;
  font-size: 0.84rem;
  font-weight: 800;
}

.itsus-ad-channel-copy small {
  color: #667b99;
  font-size: 0.79rem;
  line-height: 1.45;
}

.itsus-ad-channel-group {
  display: flex;
  flex: 1 1 420px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.itsus-naver-page-toggle {
  flex: 0 0 auto;
  border-color: rgba(3, 199, 90, 0.28);
  color: #14543a;
}

.itsus-naver-page-toggle span {
  white-space: nowrap;
}

.itsus-ad-channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d6e0ef;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #28476f;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 18px rgba(17, 47, 95, 0.05);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.itsus-ad-channel-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(17, 47, 95, 0.08);
}

.itsus-ad-channel-chip.active {
  border-color: color-mix(in srgb, var(--itsus-channel-color, #2563eb) 38%, #c9d8ee);
  background: color-mix(in srgb, var(--itsus-channel-color, #2563eb) 12%, #ffffff);
  color: color-mix(in srgb, var(--itsus-channel-color, #2563eb) 82%, #16335f);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--itsus-channel-color, #2563eb) 18%, rgba(17, 47, 95, 0.06));
}

.itsus-ad-channel-chip[data-tone="all"] { --itsus-channel-color: #2563eb; }
.itsus-ad-channel-chip[data-tone="naver"] { --itsus-channel-color: #03c75a; }
.itsus-ad-channel-chip[data-tone="coupang"] { --itsus-channel-color: #f97316; }
.itsus-ad-channel-chip[data-tone="facebook"] { --itsus-channel-color: #1877f2; }
.itsus-ad-channel-chip[data-tone="google"] { --itsus-channel-color: #4285f4; }
.itsus-ad-channel-chip[data-tone="none"] { --itsus-channel-color: #64748b; }

.itsus-ad-channel-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--itsus-channel-color, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--itsus-channel-color, #2563eb) 16%, transparent);
  flex: 0 0 auto;
}

.itsus-ad-channel-chip-label {
  white-space: nowrap;
}

.itsus-setting-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 12px;
}

.itsus-setting-select {
  margin: 0;
}

.itsus-setting-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #dbe5f5;
  border-radius: 18px;
  padding: 12px 14px;
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.itsus-setting-copy {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.itsus-setting-copy span {
  color: #14315e;
  font-size: 0.84rem;
  font-weight: 800;
}

.itsus-setting-copy small {
  color: #667b99;
  font-size: 0.79rem;
  line-height: 1.45;
}

.itsus-setting-chip-group,
.itsus-column-preset-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.itsus-setting-chip,
.itsus-preset-chip {
  border: 1px solid #cfdcef;
  border-radius: 999px;
  background: #ffffff;
  color: #28476f;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(17, 47, 95, 0.05);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.itsus-setting-chip:hover,
.itsus-preset-chip:hover {
  transform: translateY(-1px);
  border-color: #9fc2ee;
}

.itsus-setting-chip.active,
.itsus-preset-chip.active {
  border-color: #14b8a6;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(37, 99, 235, 0.10));
  color: #0f3b68;
}

.itsus-period-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(213, 224, 241, 0.92);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.98) 100%);
}

.itsus-period-card > .itsus-filter-actions,
.itsus-period-card > .itsus-date-range {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.itsus-filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.itsus-date-range {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
}

.itsus-date-range .mk-inline-field {
  min-width: 172px;
  gap: 7px;
}

.itsus-date-range-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-self: stretch;
  align-items: end;
}

.itsus-filter-help,
.itsus-filter-status,
.itsus-inventory-note {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 10px 0 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #607592;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.45;
}

.itsus-filter-status {
  margin-top: 3px;
  color: #6b7f9b;
  font-weight: 700;
}

.itsus-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.itsus-metric-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 124px;
  padding: 15px 18px 13px;
  border-radius: 18px;
  border: 1px solid rgba(210, 222, 241, 0.96);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(18, 43, 85, 0.055);
}

.itsus-metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--itsus-metric-accent, #2563eb);
}

.itsus-metric-card::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--itsus-metric-accent, #2563eb) 8%, transparent);
  opacity: 0.7;
  pointer-events: none;
}

.itsus-metric-card[data-tone="volume"] { --itsus-metric-accent: #2563eb; }
.itsus-metric-card[data-tone="inventory"] { --itsus-metric-accent: #0f766e; }
.itsus-metric-card[data-tone="holding"] { --itsus-metric-accent: #d97706; }
.itsus-metric-card[data-tone="contribution"] { --itsus-metric-accent: #0284c7; }
.itsus-metric-card[data-tone="channel"] { --itsus-metric-accent: #7c3aed; }

.itsus-metric-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.itsus-metric-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--itsus-metric-accent, #2563eb) 10%, white);
  color: color-mix(in srgb, var(--itsus-metric-accent, #2563eb) 74%, #173761);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.itsus-metric-index {
  color: rgba(86, 110, 146, 0.62);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.itsus-metric-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: end;
}

.itsus-metric-card .itsus-metric-label {
  color: #627896;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.itsus-metric-card .itsus-metric-body > strong {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: #112f5e;
  font-size: clamp(1.35rem, 1.68vw, 1.9rem);
  line-height: 1;
  letter-spacing: -0.04em;
  max-width: 100%;
  white-space: nowrap;
}

.itsus-metric-card .itsus-metric-note {
  margin: 0;
  color: #7890ad;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.itsus-metric-delta {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.itsus-metric-delta b,
.itsus-metric-delta em {
  font-style: normal;
  font-weight: 900;
}

.itsus-metric-delta[data-direction="up"] {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.itsus-metric-delta[data-direction="down"] {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.itsus-action-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.itsus-action-card {
  display: grid;
  gap: 8px;
  border: 1px solid #d9e3f3;
  border-radius: 12px;
  background: #ffffff;
  padding: 16px 18px;
  text-align: left;
  color: #132f5f;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.itsus-action-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 33, 70, 0.06);
}

.itsus-action-card.active {
  border-color: var(--itsus-action-color, #2563eb);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--itsus-action-color, #2563eb) 22%, transparent);
}

.itsus-action-card strong {
  font-size: 1rem;
  font-weight: 800;
}

.itsus-action-card span,
.itsus-action-card small {
  color: #5f7290;
}

.itsus-chart-shell {
  position: relative;
  min-height: 520px;
  border-radius: 16px;
  border: 1px solid #d9e3f3;
  background: #ffffff;
  padding: 14px;
  overflow: hidden;
}

.itsus-chart-shell::before {
  display: none;
}

.itsus-chart-shell canvas {
  width: 100% !important;
  height: 520px !important;
  position: relative;
  z-index: 1;
}

.itsus-table th,
.itsus-table td {
  vertical-align: top;
}

.itsus-table thead th.itsus-sortable-head {
  padding: 0;
}

.itsus-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 100%;
  padding: 16px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.itsus-sort-button:hover {
  background: rgba(37, 99, 235, 0.04);
}

.itsus-sort-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: -2px;
  border-radius: 10px;
}

.itsus-sort-label {
  display: inline-flex;
  align-items: center;
}

.itsus-sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  color: #7b8da8;
  font-size: 0.82rem;
  line-height: 1;
}

.itsus-table thead th[data-sort-state="desc"] .itsus-sort-icon,
.itsus-table thead th[data-sort-state="asc"] .itsus-sort-icon {
  color: #2563eb;
  font-weight: 900;
}

.itsus-table tbody tr {
  cursor: pointer;
}

.itsus-table tbody tr:hover > td {
  background: rgba(37, 99, 235, 0.055);
}

.itsus-table tbody tr.active > td {
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
  box-shadow:
    inset 0 1px 0 rgba(37, 99, 235, 0.2),
    inset 0 -1px 0 rgba(37, 99, 235, 0.18);
}

.itsus-table tbody tr.active > td:first-child {
  box-shadow:
    inset 4px 0 0 #2563eb,
    inset 0 1px 0 rgba(37, 99, 235, 0.2),
    inset 0 -1px 0 rgba(37, 99, 235, 0.18);
}

.itsus-table tbody tr.itsus-map-hidden-row > td {
  background: #fbfcff;
  color: #7f91ad;
}

.itsus-table tbody tr.active.itsus-map-hidden-row > td {
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%);
  color: #0f2a54;
}

.itsus-overview-table tbody tr.active > td {
  background: linear-gradient(180deg, #dbeafe 0%, #eef6ff 100%);
}

.itsus-overview-table tbody tr.active > td,
.itsus-overview-table tbody tr.active.itsus-map-hidden-row > td {
  background: linear-gradient(90deg, rgba(219, 234, 254, 0.98) 0%, rgba(238, 246, 255, 0.98) 100%) !important;
  color: #08265b;
  box-shadow:
    inset 0 1px 0 rgba(37, 99, 235, 0.22),
    inset 0 -1px 0 rgba(37, 99, 235, 0.18);
}

.itsus-overview-table tbody tr.active > td:first-child,
.itsus-overview-table tbody tr.active.itsus-map-hidden-row > td:first-child {
  box-shadow:
    inset 5px 0 0 #2563eb,
    inset 0 1px 0 rgba(37, 99, 235, 0.22),
    inset 0 -1px 0 rgba(37, 99, 235, 0.18);
}

.itsus-overview-table tbody tr.active .itsus-product-cell strong {
  color: #0b3b82;
}

.itsus-table .itsus-product-cell {
  min-width: 260px;
}

.itsus-overview-table {
  min-width: 1880px;
  user-select: none;
}

.itsus-overview-table th,
.itsus-overview-table td {
  white-space: nowrap;
}

.itsus-overview-table .itsus-product-cell {
  min-width: 300px;
  width: 300px;
  white-space: normal;
}

.itsus-map-toggle-cell {
  min-width: 44px;
  width: 44px;
  text-align: center;
  white-space: nowrap;
}

.itsus-map-toggle-head-cell {
  min-width: 44px;
  width: 44px;
  text-align: center;
  white-space: nowrap;
}

.itsus-overview-table .itsus-map-toggle-head-cell,
.itsus-overview-table .itsus-map-toggle-cell {
  position: sticky;
  left: 0;
}

.itsus-overview-table .itsus-map-toggle-head-cell {
  z-index: 11;
  background: #f3f7ff;
}

.itsus-overview-table .itsus-map-toggle-cell {
  z-index: 8;
  background: #ffffff;
}

.itsus-overview-table .itsus-product-head-cell,
.itsus-overview-table .itsus-product-cell {
  position: sticky;
  left: 44px;
  box-shadow: 12px 0 18px rgba(15, 39, 76, 0.08);
}

.itsus-overview-table .itsus-product-head-cell {
  z-index: 10;
  min-width: 300px;
  width: 300px;
  background: #f3f7ff;
}

.itsus-overview-table .itsus-product-cell {
  z-index: 7;
  background: #ffffff;
}

.itsus-map-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #466489;
}

.itsus-map-toggle-head {
  justify-content: center;
  width: 100%;
}

.itsus-map-toggle input {
  accent-color: #2563eb;
}

.itsus-product-cell strong {
  display: block;
  font-size: 0.97rem;
  color: #102b59;
  line-height: 1.45;
}

.itsus-product-meta {
  margin-top: 6px;
  color: #627694;
  font-size: 0.82rem;
  line-height: 1.45;
}

.itsus-action-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--itsus-action-color, #64748b) 35%, #d9e2f3);
  background: color-mix(in srgb, var(--itsus-action-color, #64748b) 12%, #ffffff);
  color: color-mix(in srgb, var(--itsus-action-color, #64748b) 85%, #102b59);
  padding: 6px 10px;
  font-size: 0.79rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.itsus-reason-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef4ff;
  border: 1px solid #d4e0f7;
  color: #33578f;
  font-size: 0.76rem;
  font-weight: 700;
  margin: 2px 6px 2px 0;
}

.itsus-muted {
  color: #7b8da8;
}

.itsus-detail-panel {
  display: grid;
  gap: 18px;
}

.itsus-detail-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.itsus-detail-card {
  display: grid;
  gap: 9px;
  border: 1px solid #d9e3f3;
  border-radius: 12px;
  background: #ffffff;
  padding: 16px 18px;
  box-shadow: none;
}

.itsus-detail-card span {
  color: #617695;
  font-size: 0.8rem;
  font-weight: 700;
}

.itsus-detail-card strong {
  color: #113062;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.itsus-detail-card-clickable {
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.itsus-detail-card-clickable:hover,
.itsus-detail-card-clickable:focus-within {
  transform: translateY(-1px);
  border-color: #b8cbeb;
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.12);
}

.itsus-detail-card small {
  color: #617695;
  font-size: 0.78rem;
  line-height: 1.45;
}

.itsus-cost-meta-line {
  display: block;
  color: #4f6486;
  font-size: 0.82rem;
  line-height: 1.45;
}

.itsus-google-summary {
  margin-bottom: 14px;
}

.itsus-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.itsus-detail-wide-panel,
.itsus-detail-execution-panel {
  width: 100% !important;
  max-width: 100%;
  margin-inline: 0 !important;
}

.itsus-query-field {
  position: relative;
}

.itsus-query-suggest {
  max-height: min(72vh, 680px);
  overflow-y: auto;
  border-radius: 18px;
  border-color: #d8e3f3;
  box-shadow: 0 18px 34px rgba(17, 47, 95, 0.12);
}

.itsus-query-suggest-count {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 12px;
  border-bottom: 1px solid #dce7f7;
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
  color: #23456f;
  font-size: 0.78rem;
  font-weight: 900;
}

.itsus-query-suggest-item .crm-suggest-name,
.itsus-query-suggest-item .crm-suggest-meta {
  display: block;
}

.itsus-query-suggest-item .crm-suggest-name {
  font-size: 0.92rem;
}

.itsus-query-suggest-item .crm-suggest-meta {
  margin-top: 3px;
}

.itsus-detail-section-head > div {
  display: grid;
  gap: 6px;
}

.itsus-detail-section-head h2 {
  font-size: 1.16rem;
  letter-spacing: -0.01em;
}

.itsus-detail-section-head p {
  margin: 0;
  color: #4f6486;
  font-size: 0.98rem;
  line-height: 1.58;
  max-width: 860px;
}

.itsus-map-page .compare-table {
  border-radius: 12px;
  overflow: hidden;
}

.itsus-map-page .compare-table thead th {
  background: #f3f7ff;
  color: #1f355a;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  border-bottom-color: #d9e3f3;
}

.itsus-map-page .compare-table tbody td {
  border-bottom-color: #d9e3f3;
  background: #ffffff;
}

.itsus-map-page .compare-table tbody tr:nth-child(even) td {
  background: #ffffff;
}

.itsus-map-page .quick-chip {
  min-height: 38px;
  padding: 8px 13px;
  border-color: rgba(202, 216, 236, 0.96);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(244, 248, 255, 0.96) 100%);
  color: #32517b;
  box-shadow: 0 8px 18px rgba(20, 49, 94, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.itsus-map-page .quick-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(114, 154, 205, 0.95);
  box-shadow: 0 12px 22px rgba(20, 49, 94, 0.08);
}

.itsus-map-page .quick-chip.active {
  background: linear-gradient(135deg, #e8f7ff 0%, #effdf6 100%);
  border-color: #75b7c7;
  color: #123f63;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), 0 10px 20px rgba(18, 76, 107, 0.12);
}

.itsus-map-page .checkbox-chip {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 249, 255, 0.96) 100%);
  border: 1px solid rgba(213, 224, 240, 0.95);
  box-shadow: 0 10px 20px rgba(20, 49, 94, 0.05);
}

.itsus-map-page .table-badge {
  border-radius: 999px;
}

.itsus-map-page .itsus-help-card {
  border-radius: 18px;
  border-color: rgba(202, 216, 235, 0.95);
  box-shadow: 0 18px 36px rgba(18, 43, 85, 0.12);
}

.itsus-map-page .itsus-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(214, 225, 240, 0.95);
  color: #496281;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(20, 49, 94, 0.04);
}

#itsusStatus {
  display: block;
  width: auto;
  max-width: 100%;
  margin: 3px 0 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #607592;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.45;
}

.itsus-inline-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.itsus-window-chip-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.itsus-window-chip-bar .quick-chip {
  min-width: 62px;
}

.itsus-option-table {
  min-width: 1600px;
  width: max-content;
  table-layout: fixed;
}

.itsus-detail-table {
  min-width: 2360px;
  width: max-content;
  table-layout: fixed;
}

.itsus-google-table {
  min-width: 1240px;
}

.itsus-option-table th,
.itsus-option-table td,
.itsus-detail-table th,
.itsus-detail-table td,
.itsus-google-table th,
.itsus-google-table td {
  white-space: nowrap;
  vertical-align: top;
  word-break: keep-all;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.35;
}

.itsus-col-option {
  width: 220px;
}

.itsus-option-name-cell {
  white-space: normal !important;
  min-width: 210px;
}

.itsus-option-name-cell strong,
.itsus-option-name-cell small {
  display: block;
}

.itsus-option-name-cell strong {
  font-weight: 800;
  color: #062455;
}

.itsus-option-name-cell small {
  margin-top: 5px;
  color: #557099;
  font-size: 12px;
  line-height: 1.35;
}

.itsus-col-barcode {
  width: 150px;
}

.itsus-col-qty {
  width: 92px;
}

.itsus-col-money {
  width: 126px;
}

.itsus-col-num {
  width: 86px;
}

.itsus-col-channel {
  width: 88px;
}

.itsus-col-keyword {
  width: 132px;
}

.itsus-col-percent {
  width: 84px;
}

.itsus-col-action {
  width: 106px;
}

.itsus-table-scroll-main {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  cursor: grab;
  overscroll-behavior-x: contain;
  scrollbar-gutter: auto;
}

.itsus-table-scroll-main.dragging {
  cursor: grabbing;
  user-select: none;
}

.itsus-table-scroll-main::-webkit-scrollbar {
  height: 12px;
}

.itsus-table-scroll-main::-webkit-scrollbar-track {
  background: rgba(220, 230, 246, 0.95);
  border-radius: 999px;
}

.itsus-table-scroll-main::-webkit-scrollbar-thumb {
  background: #8ca6cf;
  border-radius: 999px;
  border: 2px solid rgba(220, 230, 246, 0.95);
}

.itsus-channel-action-text {
  display: inline-block;
  white-space: pre-line;
  line-height: 1.25;
  text-align: center;
  max-width: 96px;
}

.itsus-link-cell-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(3, 199, 90, 0.32);
  border-radius: 999px;
  background: linear-gradient(180deg, #f7fff9 0%, #ecfff4 100%);
  color: #075f31;
  padding: 6px 10px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(3, 199, 90, 0.08);
}

.itsus-link-cell-btn:hover,
.itsus-link-cell-btn:focus-visible {
  border-color: rgba(3, 199, 90, 0.58);
  box-shadow: 0 12px 22px rgba(3, 199, 90, 0.14);
  transform: translateY(-1px);
}

.itsus-link-cell-btn small {
  color: #0f8f4a;
  font-size: 0.74rem;
  font-weight: 900;
}

.itsus-top-exposure-detail {
  margin-top: 14px;
  border: 1px solid #bfe7cf;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(3, 199, 90, 0.12), transparent 30%),
    linear-gradient(180deg, #fbfffd 0%, #f3fff8 100%);
  padding: 16px;
  box-shadow: 0 16px 36px rgba(3, 68, 35, 0.08);
}

.itsus-top-exposure-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.itsus-top-exposure-head strong {
  color: #082f1c;
  font-size: 1rem;
  font-weight: 900;
}

.itsus-top-exposure-head p {
  margin: 4px 0 0;
  color: #456553;
  font-size: 0.84rem;
}

.itsus-top-exposure-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.itsus-top-exposure-summary article {
  border: 1px solid rgba(3, 199, 90, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 11px 12px;
}

.itsus-top-exposure-summary span {
  display: block;
  color: #5d7568;
  font-size: 0.74rem;
  font-weight: 850;
  margin-bottom: 5px;
}

.itsus-top-exposure-summary strong {
  color: #062d1b;
  font-size: 0.95rem;
  font-weight: 950;
}

.itsus-top-exposure-scroll {
  max-height: 360px;
  overflow: auto;
}

.itsus-top-exposure-table {
  min-width: 920px;
  width: 100%;
}

.itsus-top-exposure-table th,
.itsus-top-exposure-table td {
  white-space: nowrap;
  padding: 9px 11px;
  font-size: 13px;
}

.itsus-overflow-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
}

.itsus-option-table .itsus-action-badge {
  white-space: normal;
  text-align: center;
  max-width: 110px;
}

.itsus-action-form {
  display: grid;
  gap: 12px;
}

.itsus-detail-execution-panel .itsus-action-form {
  max-width: 1120px;
}

.itsus-textarea-field textarea {
  min-height: 112px;
  resize: vertical;
}

.itsus-form-actions {
  display: flex;
  justify-content: flex-end;
}

.itsus-empty {
  text-align: center;
  color: #7184a1;
  padding: 18px 12px !important;
}

.itsus-history-list {
  display: grid;
  gap: 10px;
}

.itsus-history-item {
  display: grid;
  gap: 6px;
  border: 1px solid #dbe6f7;
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px 14px;
}

.itsus-history-item strong {
  color: #102b59;
  font-size: 0.9rem;
}

.itsus-history-item span,
.itsus-history-item p {
  margin: 0;
  color: #617695;
  font-size: 0.84rem;
  line-height: 1.5;
}

.itsus-dashboard-table th,
.itsus-dashboard-table td {
  white-space: nowrap;
}

.itsus-dashboard-table td .itsus-product-cell {
  min-width: 260px;
}

.itsus-channel-table {
  min-width: 1780px;
  width: max-content;
}

.itsus-channel-table th,
.itsus-channel-table td {
  white-space: nowrap;
}

.itsus-channel-table .itsus-product-cell {
  min-width: 280px;
  width: 280px;
  white-space: normal;
}

.itsus-column-modal {
  position: fixed;
  inset: 0;
  z-index: 1450;
  display: grid;
  place-items: center;
}

.itsus-column-modal.hidden {
  display: none;
}

.itsus-column-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(2px);
}

.itsus-column-modal-card {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 52px);
  overflow: auto;
  display: grid;
  gap: 14px;
  border: 1px solid #d9e4f5;
  border-radius: 18px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.24);
}

.itsus-column-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.itsus-column-preset-wrap {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dce7f6;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.itsus-column-preset-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.itsus-column-preset-head strong {
  color: #143160;
}

.itsus-column-preset-head small {
  color: #687c99;
  font-size: 0.78rem;
}

.itsus-column-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid #d8e3f5;
  border-radius: 14px;
  padding: 12px;
  background: #f8fbff;
}

.itsus-column-option.locked {
  opacity: 0.82;
  background: #f2f6fd;
}

.itsus-column-option strong {
  display: block;
  color: #143160;
  margin-bottom: 4px;
}

.itsus-column-option small {
  color: #627694;
  line-height: 1.45;
}

.itsus-roi-strong,
.itsus-roi-mid,
.itsus-roi-weak {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 800;
}

.itsus-roi-strong {
  background: #dff7e8;
  color: #0f7a42;
}

.itsus-roi-mid {
  background: #fff4d6;
  color: #9a6500;
}

.itsus-roi-weak {
  background: #ffe0e0;
  color: #b42318;
}

@media (max-width: 1100px) {
  .itsus-filter-grid,
  .itsus-setting-row,
  .itsus-cards,
  .itsus-action-card-grid,
  .itsus-detail-summary,
  .itsus-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .itsus-ad-channel-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .itsus-ad-channel-group {
    justify-content: flex-start;
  }

  .itsus-page-head {
    padding: 24px 22px;
  }

  .itsus-column-modal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .itsus-filter-grid,
  .itsus-cards,
  .itsus-action-card-grid,
  .itsus-detail-summary,
  .itsus-detail-grid {
    grid-template-columns: 1fr;
  }

  .itsus-filter-actions,
  .itsus-head-actions {
    align-items: stretch;
  }

  .itsus-page-head {
    border-radius: 24px;
  }

  .itsus-filter-panel,
  .itsus-map-page .panel {
    border-radius: 20px;
  }

  .itsus-head-actions .btn,
  .itsus-form-actions .btn {
    width: 100%;
  }
}

/* ITSUS' MAP - Naver page mapping */
.itsus-naver-page .content.content-wide-stack {
  padding-inline: clamp(14px, 1.6vw, 28px);
}

.itsus-naver-page .content.content-wide-stack > .session-banner,
.itsus-naver-page .content.content-wide-stack > .global-notice-banner,
.itsus-naver-page .content.content-wide-stack > .page-head,
.itsus-naver-page .content.content-wide-stack > .cards,
.itsus-naver-page .content.content-wide-stack > .panel {
  width: 100%;
  margin-inline: 0;
}

.itsus-naver-head {
  padding: 24px 28px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(3, 199, 90, 0.12), transparent 26%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(240, 253, 244, 0.96) 100%);
  box-shadow: 0 18px 44px rgba(13, 63, 43, 0.08);
}

.itsus-naver-head h1 {
  margin: 4px 0 8px;
  color: #082f1e;
}

.itsus-naver-head .desc {
  color: #37567c;
}

.itsus-naver-source-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.itsus-naver-source-card {
  min-height: 82px;
  padding: 16px 18px;
  border: 1px solid #cfe6d8;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f4fff8 100%);
  box-shadow: 0 12px 28px rgba(15, 70, 47, 0.07);
}

.itsus-naver-source-card span {
  color: #47705a;
  font-size: 0.82rem;
  font-weight: 800;
}

.itsus-naver-source-card strong {
  display: block;
  margin-top: 8px;
  color: #0c3b26;
  font-size: clamp(1.02rem, 1.45vw, 1.42rem);
}

.itsus-naver-filter-panel {
  width: min(1680px, 100%) !important;
  padding: 18px 20px;
}

.itsus-naver-filter-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(180px, 240px);
  gap: 14px;
}

.itsus-naver-note {
  margin: 12px 0 0;
  color: #587095;
  font-size: 0.84rem;
}

.itsus-naver-workbench {
  overflow: hidden;
  padding: 18px 20px;
}

.itsus-naver-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.itsus-naver-table-scroll {
  overflow-x: auto;
  cursor: grab;
}

.itsus-naver-table-scroll.dragging {
  cursor: grabbing;
  user-select: none;
}

.itsus-naver-table {
  min-width: 1360px;
}

.itsus-naver-table th,
.itsus-naver-table td {
  padding: 11px 12px;
  vertical-align: top;
}

.itsus-naver-table th:nth-child(1),
.itsus-naver-table td:nth-child(1) {
  min-width: 158px;
}

.itsus-naver-table th:nth-child(2),
.itsus-naver-table td:nth-child(2) {
  min-width: 230px;
}

.itsus-naver-table th:nth-child(8),
.itsus-naver-table td:nth-child(8) {
  min-width: 170px;
}

.itsus-naver-table th:first-child,
.itsus-naver-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  box-shadow: 10px 0 18px rgba(22, 51, 95, 0.08);
}

.itsus-naver-table thead th:first-child {
  z-index: 2;
  background: #f3f7ff;
}

.itsus-naver-table tbody tr {
  cursor: pointer;
}

.itsus-naver-table tbody tr:hover td {
  background: #f7fbff;
}

.itsus-naver-table tbody tr.selected td {
  background: #e8f3ff;
}

.itsus-naver-table td strong,
.itsus-naver-table td small {
  display: block;
}

.itsus-naver-table td small {
  margin-top: 4px;
  max-width: 260px;
  color: #5d7396;
  font-size: 0.76rem;
  white-space: normal;
}

.itsus-naver-url-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
}

.itsus-naver-page .itsus-naver-url-cell .btn,
.itsus-naver-page .itsus-naver-url-actions .btn,
.itsus-naver-page .itsus-naver-save-row .btn {
  min-height: 36px;
  border: 1px solid rgba(28, 87, 154, 0.42);
  border-radius: 11px;
  font-weight: 900;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 16px rgba(29, 78, 216, 0.13);
}

.itsus-naver-page .itsus-naver-url-cell .btn.small {
  min-width: 58px;
  min-height: 30px;
  padding: 6px 10px;
  background: #1d4ed8;
  border-color: #1e40af;
  color: #ffffff;
  box-shadow: 0 6px 12px rgba(29, 78, 216, 0.2);
}

.itsus-naver-page .itsus-naver-url-actions .btn.secondary,
.itsus-naver-page .itsus-naver-save-row .btn.secondary {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-color: #1e40af;
  color: #ffffff;
}

.itsus-naver-page .itsus-naver-url-actions .btn.ghost {
  background: linear-gradient(135deg, #047857, #10b981);
  border-color: #047857;
  color: #ffffff;
}

.itsus-naver-page .btn:disabled,
.itsus-naver-page .btn[disabled] {
  opacity: 1;
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #475569 !important;
  box-shadow: none;
  cursor: not-allowed;
}

.itsus-naver-url-cell span {
  overflow: hidden;
  color: #557092;
  font-size: 0.78rem;
  text-overflow: ellipsis;
}

.btn.small {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.itsus-naver-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.itsus-naver-status[data-tone="ok"] {
  background: #bbf7d0;
  border-color: #22c55e;
  color: #14532d;
}

.itsus-naver-status[data-tone="warn"] {
  background: #fde68a;
  border-color: #f59e0b;
  color: #78350f;
}

.itsus-naver-status[data-tone="bad"] {
  background: #fecaca;
  border-color: #ef4444;
  color: #7f1d1d;
}

.itsus-naver-status[data-tone="muted"] {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.itsus-naver-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid #d7e5f7;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: inset 4px 0 0 rgba(37, 99, 235, 0.16);
}

.itsus-naver-editor-empty {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 4px 0;
  color: #526985;
}

.itsus-naver-editor-empty strong {
  color: #14315e;
}

.itsus-naver-editor-head,
.itsus-naver-url-actions,
.itsus-naver-save-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.itsus-naver-editor-head span {
  display: block;
  color: #607795;
  font-size: 0.78rem;
  font-weight: 800;
}

.itsus-naver-editor-head strong {
  display: block;
  margin-top: 3px;
  color: #102f5f;
  font-size: 1.15rem;
}

.itsus-naver-editor-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f2f7ff;
  color: #4f6688;
  font-size: 0.82rem;
  line-height: 1.45;
}

.itsus-naver-url-warning {
  grid-column: 1 / -1;
  margin: -4px 0 2px;
  color: #526987;
  font-size: 0.78rem;
  line-height: 1.45;
}

.itsus-naver-editor textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid #d7e2f3;
  border-radius: 14px;
  padding: 10px 12px;
  color: #102f5f;
}

.itsus-naver-editor .mk-inline-field {
  min-width: 0;
}

.itsus-naver-editor .mk-inline-field input,
.itsus-naver-editor .mk-inline-field select,
.itsus-naver-editor .mk-inline-field textarea {
  width: 100%;
}

.itsus-naver-save-row span {
  color: #637996;
  font-size: 0.8rem;
}

.itsus-naver-keyword-scroll {
  max-height: 360px;
  overflow: auto;
}

.itsus-naver-keyword-scroll .compare-table {
  min-width: 780px;
}

@media (max-width: 1200px) {
  .itsus-naver-source-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .itsus-naver-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .itsus-naver-filter-row {
    grid-template-columns: 1fr;
  }
}

/* ITSUS AI read-only chat */
.ai-chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1450;
  display: grid;
  justify-items: end;
  gap: 12px;
  font-family: inherit;
}

.ai-chat-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, #285ccf 0%, #6d4ed7 100%);
  box-shadow: 0 14px 34px rgba(40, 66, 145, 0.28);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ai-chat-toggle:hover,
.ai-chat-toggle[aria-expanded="true"] {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(40, 66, 145, 0.36);
}

.ai-chat-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1rem;
}

.ai-chat-panel {
  width: min(460px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 116px));
  min-height: 520px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid #d9e3f4;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 70px rgba(15, 35, 75, 0.28);
  backdrop-filter: blur(14px);
}

.ai-chat-panel.hidden {
  display: none;
}

.ai-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px 15px;
  border-bottom: 1px solid #e4eaf4;
  background: linear-gradient(135deg, #0f1a31 0%, #1a2c52 72%, #314f88 100%);
  color: #fff;
}

.ai-chat-head strong {
  font-size: 1rem;
}

.ai-chat-head p {
  margin: 5px 0 0;
  color: #cbd7ee;
  font-size: 0.77rem;
  line-height: 1.4;
}

.ai-chat-beta {
  display: inline-flex;
  margin-left: 7px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #dce8ff;
  font-size: 0.62rem;
  font-weight: 900;
  vertical-align: 2px;
}

.ai-chat-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-chat-head-actions button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

#aiChatMinimize {
  display: inline-grid;
  width: 30px;
  padding: 0;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

#aiChatMinimize span {
  transform: translateY(-1px);
}

.ai-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 17px;
  background:
    radial-gradient(circle at 100% 0%, rgba(112, 145, 222, 0.1), transparent 36%),
    #f7f9fd;
}

.ai-chat-message {
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #dce5f3;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  color: #263b5d;
  box-shadow: 0 5px 14px rgba(42, 66, 105, 0.07);
}

.ai-chat-message-user {
  border-color: #4f76db;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(135deg, #3264d8, #6651cb);
  color: #fff;
}

.ai-chat-message-system {
  border-color: #edd8a4;
  background: #fffaf0;
  color: #775622;
}

.ai-chat-message-label {
  display: block;
  margin: 0 0 5px 4px;
  color: #60718d;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  line-height: 1;
}

.ai-chat-message-group {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  max-width: 88%;
  min-width: 0;
}

.ai-chat-message-group-user {
  align-self: flex-end;
  align-items: flex-end;
}

.ai-chat-message-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  line-height: 1.58;
}

.ai-chat-streaming-body::after {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background: #5576c9;
  content: "";
  vertical-align: -0.12em;
  animation: ai-chat-stream-caret 0.8s steps(1, end) infinite;
}

@keyframes ai-chat-stream-caret {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

.ai-chat-message-body p {
  margin: 0 0 8px;
}

.ai-chat-message-body p:last-child,
.ai-chat-message-body ul:last-child,
.ai-chat-message-body ol:last-child,
.ai-chat-message-body pre:last-child,
.ai-chat-message-body blockquote:last-child,
.ai-chat-message-body .ai-chat-table-wrap:last-child,
.ai-chat-message-body .ai-chat-evidence-section:last-child,
.ai-chat-evidence-content > :last-child {
  margin-bottom: 0;
}

.ai-chat-message-body h4 {
  margin: 2px 0 7px;
  color: #1f3f79;
  font-size: 0.91rem;
  line-height: 1.45;
}

.ai-chat-message-body ul,
.ai-chat-message-body ol {
  margin: 5px 0 9px;
  padding-left: 20px;
}

.ai-chat-message-body li + li {
  margin-top: 4px;
}

.ai-chat-message-body strong {
  color: #161616;
  font-weight: 900;
}

.ai-chat-message-body em {
  color: #50698e;
  font-style: italic;
}

.ai-chat-message-body code {
  padding: 1px 5px;
  border: 1px solid #d9e3f4;
  border-radius: 5px;
  background: #f1f5fc;
  color: #294b82;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.8em;
}

.ai-chat-message-body pre {
  max-width: 100%;
  margin: 7px 0 9px;
  padding: 9px 10px;
  overflow-x: auto;
  border-radius: 9px;
  background: #18243a;
  color: #edf4ff;
  white-space: pre;
}

.ai-chat-message-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.ai-chat-message-body blockquote {
  margin: 6px 0 9px;
  padding: 5px 9px;
  border-left: 3px solid #7c98db;
  background: #f1f5ff;
  color: #4d6386;
}

.ai-chat-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 8px 0 10px;
  overflow-x: auto;
  border: 1px solid #d7e1f1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(42, 66, 105, 0.06);
  white-space: normal;
  scrollbar-color: #a7b8d5 #eef3fa;
  scrollbar-width: thin;
}

.ai-chat-table-wrap:focus-visible {
  outline: 2px solid #5680df;
  outline-offset: 2px;
}

.ai-chat-markdown-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  color: #2c405f;
  font-size: 0.76rem;
  line-height: 1.42;
  white-space: normal;
}

.ai-chat-markdown-table th,
.ai-chat-markdown-table td {
  min-width: 72px;
  max-width: 220px;
  padding: 7px 9px;
  border-right: 1px solid #e1e8f3;
  border-bottom: 1px solid #e1e8f3;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.ai-chat-markdown-table th {
  background: #eaf0fb;
  color: #294a7b;
  font-weight: 850;
  white-space: nowrap;
}

.ai-chat-markdown-table tbody tr:nth-child(even) {
  background: #f8faff;
}

.ai-chat-markdown-table tr:last-child td {
  border-bottom: 0;
}

.ai-chat-markdown-table th:last-child,
.ai-chat-markdown-table td:last-child {
  border-right: 0;
}

.ai-chat-markdown-table .ai-chat-align-center {
  text-align: center;
}

.ai-chat-markdown-table .ai-chat-align-right {
  text-align: right;
}

.ai-chat-evidence-section {
  margin: 10px 0;
  overflow: hidden;
  border: 1px solid #d6e1f3;
  border-left: 4px solid #607ed4;
  border-radius: 10px;
  background: #f7f9ff;
  color: #425a7c;
  white-space: normal;
}

.ai-chat-evidence-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-bottom: 1px solid #dce5f4;
  background: #eaf0fc;
  color: #2a4f8d;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.3;
}

.ai-chat-evidence-icon {
  display: inline-grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: #607ed4;
  color: #fff;
  font-size: 0.66rem;
}

.ai-chat-evidence-content {
  padding: 8px 10px 9px;
}

.ai-chat-citation {
  display: inline-block;
  margin: 2px 1px;
  padding: 1px 5px;
  border: 1px solid #c2c8d1;
  border-radius: 999px;
  background: #d4d9e1;
  color: #5f6671;
  font-size: 0.66em;
  line-height: 1.35;
}

.ai-chat-message-meta {
  display: block;
  margin-top: 7px;
  color: #71819a;
  font-size: 0.66rem;
}

.ai-chat-message-user .ai-chat-message-meta {
  color: rgba(255, 255, 255, 0.74);
}

.ai-chat-thinking {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #526985;
  font-size: 0.82rem;
}

.ai-chat-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-chat-thinking-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5877c9;
  animation: ai-chat-thinking-bounce 1.15s infinite ease-in-out;
}

.ai-chat-thinking-dots i:nth-child(2) {
  animation-delay: 0.14s;
}

.ai-chat-thinking-dots i:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes ai-chat-thinking-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.ai-chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 10px 14px 6px;
  background: #fff;
}

.ai-chat-mode-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.ai-chat-mode-bar label {
  flex: 0 0 auto;
  color: #5d6d85;
  font-size: 0.69rem;
  font-weight: 850;
}

.ai-chat-mode-bar select {
  flex: 0 0 auto;
  min-height: 29px;
  padding: 3px 26px 3px 9px;
  border: 1px solid #c8d4e8;
  border-radius: 9px;
  background-color: #f7f9fd;
  color: #263b5d;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  cursor: pointer;
}

.ai-chat-mode-bar[data-mode="deep"] select {
  border-color: #9582ce;
  background-color: #f4f0ff;
  color: #4d378c;
}

.ai-chat-mode-bar select:disabled {
  cursor: wait;
  opacity: 0.7;
}

.ai-chat-mode-bar span {
  min-width: 0;
  overflow: hidden;
  color: #77869c;
  font-size: 0.65rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-chat-composer textarea {
  width: 100%;
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid #cbd7eb;
  border-radius: 13px;
  padding: 11px 12px;
  background: #fbfcff;
  color: #1e3559;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.45;
  outline: none;
}

.ai-chat-composer textarea:focus {
  border-color: #5f82d9;
  box-shadow: 0 0 0 3px rgba(74, 111, 208, 0.12);
}

.ai-chat-composer textarea:disabled {
  background: #f0f3f8;
  cursor: not-allowed;
}

.ai-chat-composer button {
  min-width: 58px;
  min-height: 48px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #2f63d6, #674ec9);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.ai-chat-composer button:disabled {
  background: #aab6cc;
  cursor: not-allowed;
}

.ai-chat-composer button.ai-chat-cancel {
  background: #52627b;
}

.ai-chat-foot {
  margin: 0;
  padding: 8px 14px 11px;
  border-top: 1px solid #eef2f8;
  background: #fff;
  color: #73829a;
  font-size: 0.66rem;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .ai-chat-widget {
    right: 10px;
    bottom: 10px;
  }

  .ai-chat-panel {
    width: calc(100vw - 20px);
    height: calc(100dvh - 86px);
    min-height: 0;
    border-radius: 18px;
  }

  .ai-chat-toggle {
    min-height: 44px;
    padding: 0 15px;
  }

  .ai-chat-message-group {
    max-width: 92%;
  }
}

/* Keep the mobile header visible when the sidebar opens after page scrolling. */
@media (max-width: 768px) {
  body.mobile-menu-open .app-shell {
    padding-top: 60px;
  }

  body.mobile-menu-open .topbar {
    position: fixed;
    inset: 0 0 auto;
    width: 100%;
  }
}

/* Common mobile usability: keep desktop layout unchanged. */
@media (max-width: 768px) {
  html,
  body,
  .app-shell,
  .layout,
  .content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  html,
  body {
    overflow-x: clip;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  .topbar {
    padding-inline: 10px;
    gap: 8px;
  }

  .topbar-left,
  .topbar-right {
    min-width: 0;
    gap: 6px;
  }

  .brand-word-shell,
  .topbar-session-text {
    display: none;
  }

  .topbar-session {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .topbar-session-extend,
  .topbar .btn.ghost {
    min-height: 44px;
    padding-inline: 10px;
    white-space: nowrap;
  }

  .icon-btn,
  .notification-toggle {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .layout {
    display: block;
  }

  .sidebar {
    top: 60px;
    width: min(84vw, 280px);
    max-width: calc(100vw - 48px);
    height: calc(100dvh - 60px);
    min-height: calc(100dvh - 60px);
    max-height: calc(100dvh - 60px);
    overflow: hidden;
    box-shadow: 18px 0 36px rgba(15, 23, 42, 0.24);
  }

  .sidebar .nav-link,
  .sidebar .nav-collapse-toggle {
    min-height: 44px;
  }

  .security-compact {
    padding-bottom: 8px;
  }

  .security-heading-desktop {
    display: none;
  }

  .mobile-security-toggle {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #91a3c5;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .mobile-security-toggle:hover,
  .mobile-security-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    color: #cfe0ff;
  }

  .mobile-security-items {
    display: none;
  }

  .security-compact.mobile-security-open .mobile-security-items {
    display: block;
  }

  .security-compact.mobile-security-open .mobile-security-toggle .nav-collapse-caret {
    transform: rotate(180deg);
  }

  .content {
    padding: 12px 10px 28px;
    overflow-x: clip;
  }

  .validation-wrap,
  .validation-wrap-wide,
  .content.content-wide-stack,
  .content > *,
  .validation-wrap > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .validation-wrap,
  .validation-wrap-wide {
    margin: 0;
  }

  .panel,
  .panel.compact,
  .panel.panel-compact {
    padding: 12px;
  }

  .content :is(
    [class$="-filter-grid"],
    [class*="-filter-grid "],
    [class$="-form-grid"],
    [class*="-form-grid "],
    [class$="-date-grid"],
    [class*="-date-grid "],
    [class$="-field-grid"],
    [class*="-field-grid "],
    [class$="-range-grid"],
    [class*="-range-grid "]
  ),
  .slow-stock-primary-filters,
  .slow-stock-view-tools,
  .slow-stock-okr-controls,
  .slow-stock-change-modal-tools,
  .itsus-setting-row,
  .itsus-naver-filter-row,
  .crm-compare-popover-grid,
  .dashboard-media-preview-card {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .content :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
    select,
    textarea
  ) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .content :is(input:not([type="checkbox"]):not([type="radio"]), select),
  .content .btn,
  .content .quick-chip,
  .notification-refresh,
  .notification-read-btn,
  .notification-delete-btn {
    min-height: 44px;
  }

  .content input[type="checkbox"],
  .content input[type="radio"] {
    width: 20px;
    min-width: 20px;
    height: 20px;
  }

  .po-date-open-btn,
  .po-search-toggle,
  .global-notice-close,
  .cp-ads-help-trigger {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .session-banner,
  .dashboard-control-banner,
  .global-notice-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .session-actions,
  .dashboard-query-actions,
  .mk-modal-actions,
  .itsus-filter-actions,
  .itsus-head-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .content [class*="table-scroll"] {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .content .panel:has(> table) {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .content :is(.panel > table, [class*="table-scroll"] table) {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }

  .content :is(.panel > table, [class*="table-scroll"] table) :is(th, td) {
    min-width: max-content;
    white-space: nowrap;
    word-break: keep-all;
    writing-mode: horizontal-tb;
  }

  .content table :is(
    .itsus-product-cell,
    .slow-stock-product-cell,
    .ai-usage-question,
    [class*="product-name"]
  ) {
    min-width: 180px;
    max-width: 260px;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .notification-panel {
    position: fixed;
    top: 68px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100dvh - 78px);
  }

  .notification-list {
    max-height: calc(100dvh - 142px);
  }

  .toast-stack {
    top: 68px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }

  .toast,
  .notification-message,
  .global-notice-banner,
  .session-banner {
    overflow-wrap: anywhere;
  }

  .cp-ads-help-card,
  .slow-stock-help-card {
    position: fixed;
    top: 68px;
    right: 10px !important;
    left: 10px !important;
    z-index: 1300;
    width: auto !important;
    max-width: none;
    max-height: calc(100dvh - 78px) !important;
    overflow: auto;
  }

  .mk-modal,
  .itsus-column-modal {
    align-items: start;
    overflow-y: auto;
    padding: 10px;
  }

  .mk-modal-card,
  [class$="-modal-card"],
  [class*="-modal-card "] {
    width: 100% !important;
    max-width: 100%;
    max-height: calc(100dvh - 20px) !important;
    margin: 0;
    padding: 14px;
    overflow: auto;
  }

  .po-date-quick-popover.open,
  .crm-compare-popover {
    position: fixed;
    top: 68px !important;
    right: 10px !important;
    bottom: 10px;
    left: 10px !important;
    width: auto;
    max-height: none;
    overflow: auto;
  }

  .po-date-quick-popover.open {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .po-date-preset-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 176px;
    border-right: 0;
    border-bottom: 1px solid #d7e3f7;
  }

  .ai-chat-widget {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 20px);
  }

  .cost-dashboard-page .content.content-wide-stack > .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .cost-dashboard-page .dashboard-cost-card {
    min-height: 96px;
    padding: 12px;
  }

  .cost-dashboard-page .dashboard-cost-card strong {
    overflow-wrap: anywhere;
    font-size: clamp(1rem, 5vw, 1.32rem);
  }

  .cost-dashboard-page .dashboard-query-submit,
  .cost-dashboard-page .dashboard-query-submit .btn {
    width: 100%;
  }

  .cost-dashboard-page .dashboard-chart-shell {
    height: 290px;
    min-height: 290px;
  }

  .cost-dashboard-page .dashboard-item-chart-shell {
    height: 320px;
    min-height: 320px;
  }

  .cost-dashboard-page #dashboardCostChart,
  .cost-dashboard-page #dashboardItemChart {
    width: 100% !important;
    height: 100% !important;
    max-height: none;
  }

  .cost-dashboard-page .dashboard-rank-card-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .cost-dashboard-page .dashboard-rank-card {
    position: relative;
    grid-template-columns: 88px minmax(0, 1fr);
    grid-template-areas:
      "image title"
      "image subtitle"
      "image code"
      "metrics metrics";
    gap: 7px 12px;
    min-height: 0;
    padding: 12px;
  }

  .cost-dashboard-page .dashboard-rank-card-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
  }

  .cost-dashboard-page .dashboard-rank-card-image-wrap {
    grid-area: image;
    align-self: start;
  }

  .cost-dashboard-page .dashboard-rank-card-image,
  .cost-dashboard-page .dashboard-rank-card-image.placeholder {
    width: 88px;
    height: 88px;
    border-radius: 10px;
  }

  .cost-dashboard-page .dashboard-rank-card-title {
    grid-area: title;
    align-self: end;
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .cost-dashboard-page .dashboard-rank-card-subtitle {
    grid-area: subtitle;
    font-size: 0.76rem;
    line-height: 1.3;
  }

  .cost-dashboard-page .dashboard-rank-card-code {
    grid-area: code;
    width: 100%;
    margin: 0;
    border-radius: 7px;
    padding: 5px 7px;
  }

  .cost-dashboard-page .dashboard-rank-card-metrics {
    grid-area: metrics;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 2px;
  }

  .cost-dashboard-page .dashboard-rank-card-metrics span {
    min-width: 0;
    border-radius: 7px;
    padding: 6px 8px;
  }

  .cost-dashboard-page .dashboard-rank-card-metrics strong {
    overflow-wrap: anywhere;
  }

  .cost-dashboard-page .dashboard-rank-pager {
    justify-content: flex-start;
  }

  .cost-dashboard-page .content {
    padding-bottom: 92px;
  }
}
/* Mobile review follow-up: navigation, overlays, and long tables. */
@media (max-width: 768px) {
  .app-shell:not(.sidebar-open) > .layout > .sidebar {
    transform: translate3d(-100%, 0, 0) !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .app-shell.sidebar-open > .layout > .sidebar {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .global-notice-banner {
    position: relative !important;
    top: auto !important;
  }

  .ai-chat-toggle {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .ai-chat-toggle > span:not(.ai-chat-toggle-icon) {
    display: none;
  }

  body.po-chart-expanded .ai-chat-widget,
  body.slow-stock-order-chart-expanded .ai-chat-widget {
    display: none;
  }

  .slow-stock-page .slow-stock-table-scroll {
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }
}

/* Shared light/dark appearance. The saved choice is applied by theme.js. */
.theme-toggle {
  display: inline-grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(226, 232, 240, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fbff;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(147, 197, 253, 0.72);
  background: rgba(96, 165, 250, 0.2);
  color: #ffffff;
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.32);
  outline-offset: 2px;
}

.theme-toggle-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
}

.theme-toggle-auth {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 950;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
}

html[data-theme="dark"] {
  --bg-page: #101214;
  --bg-card: #1a1d21;
  --bg-topbar: #0c0e10;
  --bg-sidebar: #14171a;
  --line: #3a4048;
  --text-main: #eceff3;
  --text-subtle: #a9afb7;
  --accent: #3b82f6;
  --danger: #fb7185;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  background: var(--bg-page);
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background-color: var(--bg-page);
  color: var(--text-main);
}

html[data-theme="dark"] .dashboard-page {
  background: #101214;
}

html[data-theme="dark"] .topbar {
  background: var(--bg-topbar);
  border-bottom: 1px solid #2b3036;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .sidebar {
  background: var(--bg-sidebar);
  border-right-color: #2e343b;
}

html[data-theme="dark"] .content {
  color: var(--text-main);
}

html[data-theme="dark"] body:not(.login-page) :is(
  .panel,
  .metric-card,
  .admin-kpi,
  .po-box,
  .session-banner,
  .dashboard-control-banner,
  .global-loading-card,
  .notification-panel,
  .notification-item,
  .table-scroll,
  .compare-table td,
  [class$="-modal-card"],
  [class*="-modal-card "],
  [class$="-popover"],
  [class*="-popover "],
  [class$="-dropdown"],
  [class*="-dropdown "],
  [class$="-suggest"],
  [class*="-suggest "],
  [class$="-chart-box"],
  [class*="-chart-box "],
  [class$="-chart-shell"],
  [class*="-chart-shell "],
  [class$="-rank-card"],
  [class*="-rank-card "],
  [class$="-filter-panel"],
  [class*="-filter-panel "]
) {
  border-color: var(--line);
  background-color: var(--bg-card);
  background-image: none;
  color: var(--text-main);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] body:not(.login-page) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
  select,
  textarea
) {
  border-color: #49515b;
  background-color: #15191d;
  color: #eceff3;
}

html[data-theme="dark"] body:not(.login-page) :is(input, textarea)::placeholder {
  color: #858d97;
  opacity: 1;
}

html[data-theme="dark"] body:not(.login-page) :is(input, select, textarea):focus {
  border-color: #60a5fa;
  outline-color: rgba(96, 165, 250, 0.34);
}

html[data-theme="dark"] body:not(.login-page) :is(input[type="checkbox"], input[type="radio"]) {
  accent-color: #60a5fa;
}

html[data-theme="dark"] :is(.page-head, .panel-head, .po-box, .admin-form, .compare-table) :is(h1, h2, h3, label),
html[data-theme="dark"] :is(.session-text, .notification-title, .notification-message, .check-row),
html[data-theme="dark"] .eyebrow {
  color: var(--text-main);
}

html[data-theme="dark"] :is(
  .desc,
  .panel-head p,
  .notification-meta,
  .admin-kpi span,
  .po-box .desc,
  .ai-usage-filter-grid label,
  .slow-stock-product-cell span,
  .slow-stock-new-model-cell small,
  .slow-stock-kpi-meta,
  .slow-stock-map-head p
) {
  color: var(--text-subtle);
}

html[data-theme="dark"] .session-text strong {
  color: #93c5fd;
}

html[data-theme="dark"] .compare-table :is(th, td),
html[data-theme="dark"] [class*="table"] :is(th, td) {
  border-color: #3a4048;
}

html[data-theme="dark"] .compare-table thead th,
html[data-theme="dark"] [class*="table"] thead th {
  background-color: #24292f;
  color: #e4e7eb;
}

html[data-theme="dark"] .compare-table tbody tr:nth-child(even) td,
html[data-theme="dark"] [class*="table"] tbody tr:nth-child(even) td {
  background-color: #16191d;
}

html[data-theme="dark"] .compare-table tbody tr:hover td,
html[data-theme="dark"] [class*="table"] tbody tr:hover td {
  background-color: #252b32;
}

html[data-theme="dark"] .card-primary {
  border-color: #315b9f;
  background: #20252b;
  color: #dbeafe;
}

html[data-theme="dark"] .card-warning,
html[data-theme="dark"] .mk-trend-down-soft {
  border-color: #7b5c22;
  background: #342a18;
  color: #fde68a;
}

html[data-theme="dark"] .card-success {
  border-color: #276b58;
  background: #12362f;
  color: #a7f3d0;
}

html[data-theme="dark"] .card-danger,
html[data-theme="dark"] .mk-trend-down-strong {
  border-color: #8a3c50;
  background: #3a1e28;
  color: #fecdd3;
}

html[data-theme="dark"] :is(.metric-card-badge, .metric-pill) {
  border-color: rgba(203, 213, 225, 0.2);
  background: rgba(32, 37, 43, 0.72);
  color: inherit;
}

html[data-theme="dark"] .session-banner,
html[data-theme="dark"] .dashboard-control-banner {
  border-color: #31557f;
  background: #20252b;
}

html[data-theme="dark"] .global-notice-banner {
  border-color: #7c6324;
  background: #332a16;
  color: #fde68a;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .global-notice-close {
  border-color: rgba(253, 230, 138, 0.34);
  background: rgba(32, 37, 43, 0.72);
  color: #fde68a;
}

html[data-theme="dark"] .notification-panel-head,
html[data-theme="dark"] .notification-item {
  border-color: var(--line);
}

html[data-theme="dark"] .notification-item.unread {
  background: #172b47;
}

html[data-theme="dark"] :is(.notification-refresh, .notification-read-btn) {
  border-color: #4c555f;
  background: #20252b;
  color: #cbd5e1;
}

html[data-theme="dark"] .notification-delete-btn {
  border-color: #854d25;
  background: #3b281a;
  color: #fdba74;
}

html[data-theme="dark"] .btn.secondary {
  background: #4a515a;
}

html[data-theme="dark"] .quick-chip,
html[data-theme="dark"] [class$="-chip"],
html[data-theme="dark"] [class*="-chip "] {
  border-color: #4b5561;
}

html[data-theme="dark"] :is(.dashboard-cache-status.info, .ai-usage-mode) {
  background: #172b47;
  color: #bfdbfe;
}

html[data-theme="dark"] :is(.dashboard-cache-status.warning, .desc.warning) {
  background: #342a18;
  color: #fde68a;
}

html[data-theme="dark"] .dashboard-cache-status.error {
  background: #3a1e28;
  color: #fecdd3;
}

html[data-theme="dark"] .ai-usage-status.success {
  background: #12362f;
  color: #a7f3d0;
}

html[data-theme="dark"] .ai-usage-status.error {
  background: #3a1e28;
  color: #fecdd3;
}

html[data-theme="dark"] .ai-usage-mode.deep {
  background: #2c2445;
  color: #ddd6fe;
}

html[data-theme="dark"] .ai-chat-panel {
  border-color: var(--line);
  background: #191d22;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .ai-chat-messages {
  background: #14181c;
}

html[data-theme="dark"] .ai-chat-message:not(.ai-chat-message-user) {
  border-color: #3a4048;
  background: #20252b;
  color: #d9e3f1;
}

html[data-theme="dark"] .ai-chat-message-system {
  border-color: #725b28;
  background: #332a18;
  color: #fde68a;
}

html[data-theme="dark"] .ai-chat-message-label,
html[data-theme="dark"] .ai-chat-message-meta,
html[data-theme="dark"] .ai-chat-thinking {
  color: #9fb0c8;
}

html[data-theme="dark"] .ai-chat-message-body :is(h4, strong) {
  color: #eff6ff;
}

html[data-theme="dark"] .ai-chat-message-body :is(code, blockquote),
html[data-theme="dark"] .ai-chat-evidence-section,
html[data-theme="dark"] .ai-chat-table-wrap {
  border-color: #424951;
  background: #171b20;
  color: #cbd5e1;
}

html[data-theme="dark"] .ai-chat-evidence-title,
html[data-theme="dark"] .ai-chat-markdown-table th {
  border-color: #424951;
  background: #24292f;
  color: #bfdbfe;
}

html[data-theme="dark"] .ai-chat-markdown-table {
  color: #d9e3f1;
}

html[data-theme="dark"] .ai-chat-markdown-table tbody tr:nth-child(even) {
  background: #16191d;
}

html[data-theme="dark"] :is(.ai-chat-composer, .ai-chat-foot) {
  border-color: #3a4048;
  background: #191d22;
  color: #9fb0c8;
}

html[data-theme="dark"] .ai-chat-mode-bar :is(label, span) {
  color: #9fb0c8;
}

html[data-theme="dark"] .ai-chat-mode-bar select,
html[data-theme="dark"] .ai-chat-composer textarea {
  border-color: #4c555f;
  background-color: #15191d;
  color: #eceff3;
}

html[data-theme="dark"] .ai-chat-mode-bar[data-mode="deep"] select {
  border-color: #7c6bb3;
  background-color: #2c2445;
  color: #ddd6fe;
}

html[data-theme="dark"] .login-card {
  border-color: #414850;
  background: rgba(25, 29, 34, 0.97);
  color: #eceff3;
}

html[data-theme="dark"] .login-form label {
  color: #cbd5e1;
}

html[data-theme="dark"] .login-form input {
  border-color: #4a525c;
  background: #14181c;
  color: #f1f5f9;
}

html[data-theme="dark"] .device-approval-status {
  border-color: #4f83d7;
  background: #172b47;
  color: #dbeafe;
}

html[data-theme="dark"] .otp-qr-image {
  border-color: #54657e;
  background: #ffffff;
}

@media (max-width: 768px) {
  .theme-toggle {
    width: 44px;
    height: 44px;
  }

  .theme-toggle-auth {
    top: 10px;
    right: 10px;
  }
}
