:root {
  --bg: #0b0c11;
  --bg-deep: #07080c;
  --surface: #11131a;
  --surface-2: #171a24;
  --surface-3: #212736;
  --surface-glass: #11131a;
  --bg-ambient: radial-gradient(1180px 660px at 84% -12%, rgba(124, 158, 255, 0.07), transparent 62%),
    radial-gradient(980px 620px at 6% 108%, rgba(109, 206, 184, 0.055), transparent 60%);
  --nm-light: rgba(158, 180, 242, 0.075);
  --nm-dark: rgba(0, 0, 0, 0.88);
  --rim: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
  --rim-soft: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --nm-out-xs: 0 0 0 1px var(--line);
  --nm-out-sm: 0 0 0 1px var(--line);
  --nm-out: 0 0 0 1px var(--line);
  --nm-out-lg: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line-strong);
  --nm-in-xs: inset 0 0 0 1px var(--line);
  --nm-in-sm: inset 0 0 0 1px var(--line);
  --nm-in: inset 0 0 0 1px var(--line);
  --nm-in-accent: inset 0 0 0 1px rgba(124, 158, 255, 0.28);
  --nm-out-accent: 0 0 0 1px rgba(124, 158, 255, 0.32);
  --border: transparent;
  --border-soft: transparent;
  --border-strong: transparent;
  --overlay: rgba(2, 3, 6, 0.74);
  --ink-on-accent: #0b0c11;
  --input-bg: #0c0e14;
  --input-border: rgba(255, 255, 255, 0.09);
  --input-border-focus: rgba(124, 158, 255, 0.7);
  --input-ring: rgba(124, 158, 255, 0.16);
  --text: #eef1f9;
  --text-dim: #b2bacd;
  --text-mute: #808ba2;
  --periwinkle: #7c9eff;
  --periwinkle-soft: #a9c3ff;
  --periwinkle-glow: rgba(124, 158, 255, 0.13);
  --mint: #6dceb8;
  --mint-glow: rgba(109, 206, 184, 0.13);
  --accent: #7c9eff;
  --accent-soft: #a9c3ff;
  --accent-strong: #8aa6ff;
  --accent-glow: rgba(124, 158, 255, 0.13);
  --accent-rim: rgba(124, 158, 255, 0.28);
  --coral: #e8897f;
  --amber: #d8b26a;
  --growth: #c3cbdc;
  --brand-gradient: linear-gradient(135deg, #7c9eff, #6dceb8);
  --brand-gradient-soft: linear-gradient(135deg, rgba(124, 158, 255, 0.14), rgba(109, 206, 184, 0.12));
  --btn-gradient: linear-gradient(135deg, #7c9eff, #6dceb8);
  --btn-gradient-soft: linear-gradient(135deg, rgba(124, 158, 255, 0.14), rgba(109, 206, 184, 0.12));
  --btn-glow: none;
  --btn-glow-strong: none;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-pill: 999px;
  --shadow: var(--nm-out);
  --shadow-lift: var(--nm-out-lg);
  --shadow-soft: var(--nm-out-sm);
  --ring: 0 0 0 3px var(--input-ring);
  --font: "IRANSans", sans-serif;
  --topbar-bg: var(--surface);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  font-family: var(--font);
  font-size: 14px;
  background-color: var(--bg);
  background-image: var(--bg-ambient);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(124, 158, 255, 0.3);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-mute);
  background-clip: padding-box;
}

button,
input,
select,
textarea {
  font-family: var(--font);
}

a {
  color: var(--periwinkle);
  text-decoration: none;
  transition: color 0.16s var(--ease);
}

a:hover {
  color: var(--accent-soft);
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(124, 158, 255, 0.55);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.hidden {
  display: none !important;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-dim);
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease), box-shadow 0.16s var(--ease),
    transform 0.16s var(--ease-out);
}

.btn:hover {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-primary,
.btn-ai {
  color: var(--accent-soft);
  background: rgba(124, 158, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(124, 158, 255, 0.3);
}

.btn-primary:hover,
.btn-ai:hover {
  color: #ffffff;
  background: rgba(124, 158, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(124, 158, 255, 0.5);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11.5px;
}

.btn-danger {
  color: var(--coral);
  background: rgba(232, 137, 127, 0.08);
  box-shadow: inset 0 0 0 1px rgba(232, 137, 127, 0.28);
}

.btn-danger:hover {
  color: var(--coral);
  background: rgba(232, 137, 127, 0.15);
  box-shadow: inset 0 0 0 1px rgba(232, 137, 127, 0.5);
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-mute);
  cursor: pointer;
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.icon-btn:active {
  background: var(--surface-3);
}

.icon-btn.danger:hover {
  color: var(--coral);
  background: rgba(232, 137, 127, 0.1);
  box-shadow: inset 0 0 0 1px rgba(232, 137, 127, 0.4);
}

.field {
  min-width: 0;
}

.field label,
.control label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 7px;
}

.field input,
.field select,
.field textarea,
.control select,
.control input[type="text"],
.control input[type="search"],
.jdp-input {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  box-shadow: none;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), color 0.16s var(--ease);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--line-strong);
}

.field select,
.channel-controls select,
.bulk-interval-row select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23808ba2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 12px;
  cursor: pointer;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.control select:focus,
.control input[type="text"]:focus,
.control input[type="search"]:focus,
.jdp-input:focus {
  border-color: var(--input-border-focus);
  box-shadow: var(--ring);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-mute);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}

.app-notices {
  position: fixed;
  bottom: 18px;
  inset-inline-start: 18px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(390px, calc(100vw - 36px));
}

.app-notice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--nm-out-lg);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.26s var(--ease-out), transform 0.26s var(--ease-out);
}

.app-notice.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-notice.leaving {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}

.app-notice-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--periwinkle);
  background: transparent;
  box-shadow: none;
}

.app-notice-icon svg {
  width: 20px;
  height: 20px;
}

.app-notice-content {
  flex: 1;
  min-width: 0;
}

.app-notice-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.app-notice-body {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--text-dim);
}

.app-notice-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.app-notice-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  color: var(--text-mute);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease);
}

.app-notice-close svg {
  width: 14px;
  height: 14px;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  display: inline-block;
  cursor: pointer;
}

.switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  pointer-events: none;
}

.slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-mute);
  top: 50%;
  transform: translateY(-50%);
  inset-inline-start: 3px;
  transition: inset-inline-start 0.2s var(--ease), background-color 0.2s var(--ease);
}

.switch:hover .slider {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.switch input:checked + .slider {
  background: var(--mint);
  box-shadow: none;
}

.switch input:checked + .slider::before {
  inset-inline-start: calc(100% - 19px);
  background: #ffffff;
}

.switch input:focus-visible + .slider {
  box-shadow: var(--ring);
}

.switch input:disabled {
  cursor: not-allowed;
}

.switch input:disabled + .slider {
  opacity: 0.5;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px 20px;
  font-size: 12.5px;
  color: var(--text-mute);
  text-align: center;
  line-height: 2;
}

.empty-state .empty-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.empty-state .empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-mute);
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--periwinkle);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  max-width: min(90vw, 420px);
  padding: 11px 20px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text);
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--nm-out-lg);
  animation: toastIn 0.3s var(--ease-spring);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 14px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.form-error {
  margin-top: 12px;
  padding: 12px 15px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--coral);
  background: transparent;
  border: 1px solid rgba(232, 137, 127, 0.35);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

body.platform-bale #windowHours,
body.platform-bale .window-hours-field,
body.platform-bale #openHeatmapBtn {
  display: none !important;
}

.modal-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: none;
  color: var(--text-mute);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-close:hover,
.app-notice-close:hover,
.chart-note-pop-close:hover,
.ai-chat-item-del:hover {
  color: var(--coral);
  background: rgba(232, 137, 127, 0.14);
  box-shadow: none;
}

.modal-close:active,
.app-notice-close:active,
.chart-note-pop-close:active,
.ai-chat-item-del:active {
  background: rgba(232, 137, 127, 0.22);
  box-shadow: none;
}

.icon-btn.logout:hover {
  color: var(--coral);
}

input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  display: none;
}

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 640px) {
  ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }

  .btn {
    padding: 10px 15px;
  }
}

.mx-line {
  stroke-dasharray: 100;
  animation: brand-chart-draw 3.2s ease-in-out infinite;
}

.mx-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: brand-chart-dot 3.2s ease-in-out infinite;
}

@keyframes brand-chart-draw {
  0% { stroke-dashoffset: 100; opacity: 1; }
  52% { stroke-dashoffset: 0; opacity: 1; }
  84% { stroke-dashoffset: 0; opacity: 1; }
  96% { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 100; opacity: 0; }
}

@keyframes brand-chart-dot {
  0%, 46% { opacity: 0; transform: scale(0); }
  58% { opacity: 1; transform: scale(1.35); }
  66%, 84% { opacity: 1; transform: scale(1); }
  96%, 100% { opacity: 0; transform: scale(0.5); }
}

@media (prefers-reduced-motion: reduce) {
  .mx-line,
  .mx-dot {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.powered-by {
  margin-top: 26px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.2px;
  color: var(--text-mute);
  direction: ltr;
}

.powered-by a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.powered-by a:hover {
  color: var(--periwinkle);
}

.glow-strip {
  height: 2px;
  border-radius: var(--radius-pill);
  margin: 4px 2px 20px;
  opacity: 0.6;
  background: linear-gradient(
    90deg,
    var(--periwinkle),
    var(--mint),
    var(--growth),
    var(--amber),
    var(--coral),
    var(--mint),
    var(--periwinkle)
  );
  background-size: 300% 100%;
  animation: glowStripFlow 6s ease-in-out infinite alternate;
}

@keyframes glowStripFlow {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 100% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glow-strip {
    animation: none;
  }
}

@media (max-width: 820px) {
  .glow-strip {
    margin-bottom: 14px;
  }
}
