.target-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tabs {
  background-color: var(--secondary-bg);
  padding: 4px;
  border-radius: 20px;
  display: flex;
}

.tab-btn {
  border: none;
  background: none;
  padding: 6px 16px;
  border-radius: 16px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.tab-btn.active {
  background-color: var(--primary-color);
  color: white;
}

.tab-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Layout */
.creation-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

/* Form Styles */
.form-group {
  margin-bottom: var(--form-row-gap);
}

label {
  display: block;
  margin-bottom: var(--form-label-gap);
  font-weight: 500;
  font-size: 13px;
  color: var(--text-color);
}

.form-stack {
  display: grid;
  row-gap: var(--form-stack-row-gap);
  align-content: start;
}

.form-stack > .form-group,
.form-stack > .floating-group,
.form-stack > .status-group,
.form-stack > .checkbox-group {
  margin-bottom: 0;
}

.form-stack .field-meta-stack {
  display: grid;
  row-gap: var(--form-meta-gap);
}

.form-section-divider {
  margin-top: var(--form-section-gap);
  border-top: 1px solid var(--border-color);
  padding-top: var(--form-section-gap);
}

.form-inline-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.info-icon {
  position: relative;
  color: var(--text-secondary);
  cursor: help;
  font-size: 16px;
  margin-right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  top: 2px;
  line-height: 0;
}

.info-icon .info-icon-svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Tooltip Styles for info-icon */
.info-icon::before {
  content: attr(data-title);
  visibility: hidden;
  opacity: 0;
  width: max-content;
  max-width: 250px;
  background-color: #222; /* Darker background */
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 12px;
  position: absolute;
  z-index: var(--z-tooltip);
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  transition: opacity 0.2s, transform 0.2s;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  white-space: normal;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  font-family: "Vazirmatn", sans-serif;
  font-weight: normal;
}

.info-icon::after {
  content: "";
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 140%; /* Matches tooltip bottom position roughly */
  left: 50%;
  margin-left: -5px;
  margin-bottom: -10px; /* Pull arrow down to connect */
  border-width: 5px;
  border-style: solid;
  border-color: #222 transparent transparent transparent;
  z-index: var(--z-tooltip);
  transition: opacity 0.2s;
}

.info-icon:hover::before,
.info-icon:hover::after {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

input[type="text"],
input[type="url"],
input[type="number"],
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

textarea {
  resize: vertical;
  min-height: 50px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--input-focus-border);
}

.ltr-input {
  direction: ltr;
  text-align: left;
}

.helper-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.3;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-group input[type="checkbox"],
.terms-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #c7d0db;
  border-radius: 5px;
  background-color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.16s ease;
}

.checkbox-group input[type="checkbox"]:checked,
.terms-checkbox input[type="checkbox"]:checked {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.3 8.4l2.3 2.4 7.1-6.9' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

.checkbox-group input[type="checkbox"]:focus-visible,
.terms-checkbox input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.22);
}

.checkbox-group input[type="checkbox"]:disabled,
.terms-checkbox input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.checkbox-group label {
  margin-bottom: 0;
  font-weight: 500;
  cursor: pointer;
}

.upload-btn {
  width: 100%;
  padding: 8px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.upload-btn:hover {
  background-color: var(--primary-hover);
}

/* Floating Label Group */
.floating-group {
  position: relative;
  margin-bottom: var(--form-floating-row-gap);
}

.floating-group input,
.floating-group textarea {
  background-color: transparent; /* Allows label behind if needed, but we put label on top with white bg */
  padding: 12px 12px; /* Increased padding for comfort */
}

/* Floating Label Element */
.floating-group label,
.floating-label {
  position: absolute;
  right: 12px;
  top: 0;
  transform: translateY(-50%) scale(0.9);
  background-color: #fff;
  padding: 0 6px;
  color: var(--text-secondary);
  font-size: 14px;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 5;
  transform-origin: right top;
  margin-bottom: 0; /* Reset default label margin */
  line-height: 1;
  direction: rtl; /* Ensure label is always RTL even inside LTR wrappers */
}

/* Floating State (Focus or Value present) */
.floating-group input:focus ~ label,
.floating-group input:not(:placeholder-shown) ~ label,
.floating-group textarea:focus ~ label,
.floating-group textarea:not(:placeholder-shown) ~ label,
.floating-group .input-currency-wrapper:focus-within .floating-label,
.floating-group .cpm-fake-input-wrapper:focus-within .floating-label,
.floating-label.active {
  color: var(--primary-color);
  font-weight: 500;
}

/* When not focused but has value (detected via placeholder-shown or JS class) */
.floating-group input:not(:focus):not(:placeholder-shown) ~ label,
.floating-group textarea:not(:focus):not(:placeholder-shown) ~ label,
.floating-label.has-value {
  color: var(
    --text-secondary
  ); /* Keep it grey if just filled but not focused */
}

/* Textarea Adjustments */
.floating-group textarea + label {
  /* top: 24px; REMOVED - Always on top */
}

.floating-group textarea {
  /* padding-top: 24px; REMOVED - Match input style */
}

/* Currency & CPM Specifics */
/* Toman Suffix Position in Floating Group - Move to LEFT */
.floating-group .currency-suffix-unified {
  left: 12px !important;
  right: auto !important;
  direction: ltr;
}

/* Input Padding for Currency in Floating Group */
.floating-group .input-currency-wrapper input {
  padding-left: 60px !important; /* Space for Toman on Left */
  padding-right: 12px !important; /* Normal padding on Right */
  text-align: right; /* Numbers align to Right for correct reading order with Toman on Left (1000 ... Toman) */
  direction: ltr;
}

/* CPM Wrapper Adjustments for Floating Label */
.cpm-fake-input-wrapper {
  justify-content: flex-end; /* Align content to Right (RTL Start)? No, we want Input to fill. */
  /* We will use absolute positioning for badges/toman */
}

.cpm-left-section {
  /* Toman and Badges */
  /* position: absolute; REMOVED for Flex Layout */
  /* left: 12px; */
  /* top: 50%; */
  /* transform: translateY(-50%); */
  margin: 0;
  /* z-index: 2; */
  pointer-events: none; /* Let clicks pass to input */
}

.cpm-transparent-input {
  width: 100%;
  padding-left: 10px !important; /* Small padding, was 100px */
  padding-right: 12px !important;
  text-align: right; /* Numbers LTR but aligned right */
}

/* Hide static text if we are using absolute positioning now? */
/* Actually, let's keep the classes but override in .floating-group context */

/* Unified Currency Suffix for Inputs */
.currency-suffix-unified {
  position: absolute !important;
  left: 12px !important;
  right: auto !important;
  top: 50%;
  transform: translateY(-50%);
  color: #707579;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  z-index: 10;
  font-family: "Vazirmatn", sans-serif;
  line-height: 1; /* Fix vertical alignment */
}

/* Base styles for all currency inputs */
.input-currency-wrapper {
  position: relative;
  width: 100%;
  display: block; /* Ensure it's a block container */
}

.input-currency-wrapper input {
  width: 100%;
  padding-left: 60px !important; /* Unified padding for currency */
  padding-right: 12px !important;
  text-align: right;
  direction: ltr;
  font-family: "Vazirmatn", sans-serif;
  height: 48px; /* Taller for floating label */
  font-size: 14px;
  border: 1px solid var(--border-color); /* Restore border */
  border-radius: var(--radius); /* Restore radius */
  background-color: var(--input-bg); /* Restore background */
}

/* --- CPM Flex Wrapper Styles (Fixes Overlap) --- */
.cpm-fake-input-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  height: 48px; /* Taller */
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--input-bg);
  padding: 0 10px;
  direction: ltr; /* Force LTR Layout for Order: Badge -> Input -> Toman */
  transition: border-color 0.2s;
}

.cpm-fake-input-wrapper:focus-within {
  border-color: var(--input-focus-border);
}

.cpm-left-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-right: 0;
  margin-left: 8px;
  z-index: 20; /* Keep CPM tooltip above channel icon preview layer */
}

.cpm-badge-static {
  background-color: #ffe4d3;
  color: #df6a18;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  cursor: help;
  white-space: nowrap;
  line-height: 1.5;
  display: flex;
  align-items: center;
  pointer-events: auto;
}

/* Tooltip for Badge (re-implemented for static class) */
.cpm-badge-static {
  position: relative; /* Ensure it is a positioning context */
}

.cpm-badge-static[data-title]:hover::after {
  content: attr(data-title);
  position: absolute;
  bottom: 100%;
  left: 50%; /* Center horizontally */
  right: auto; /* Reset right */
  transform: translateX(-50%); /* Center horizontally */
  background-color: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: pre-wrap;
  min-width: 200px; /* Reduced width */
  text-align: center; /* Center text */
  direction: rtl; /* RTL direction */
  z-index: var(--z-tooltip);
  margin-bottom: 8px; /* Space from badge */
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cpm-badge-static[data-title]:hover::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%; /* Center horizontally */
  right: auto; /* Reset right */
  transform: translateX(-50%); /* Center horizontally */
  border-width: 6px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
  margin-bottom: -4px; /* Push down to touch badge */
  z-index: var(--z-tooltip);
}

.cpm-approx-static {
  color: #aeb4b9;
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
}

.cpm-transparent-input {
  flex-grow: 1;
  border: none !important;
  outline: none !important;
  padding: 0 !important;
  background: transparent !important;
  text-align: right; /* Numbers align to Right (near Toman) */
  direction: ltr;
  font-family: "Vazirmatn", sans-serif;
  font-size: 14px;
  height: 100%;
  width: 100%;
}

.cpm-currency-static {
  color: #707579;
  font-size: 13px; /* Unified Size */
  font-weight: 500; /* Unified Weight */
  margin-right: 8px;
  margin-left: 0;
  flex-shrink: 0;
  pointer-events: none;
  font-family: "Vazirmatn", sans-serif;
}
/* ----------------------------------------------- */

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.link-action {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 13px;
}

.link-action:hover {
  text-decoration: underline;
}

.daily-limit-helper {
  margin-top: 5px;
}

.input-currency-wrapper.with-inline-action .field-inline-action {
  position: absolute;
  left: 52px;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  min-height: 22px;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
  text-decoration: none;
}

.input-currency-wrapper.with-inline-action input {
  padding-left: 176px !important;
}

@media (max-width: 560px) {
  .input-currency-wrapper.with-inline-action .field-inline-action {
    left: 48px;
    padding: 2px 7px;
    font-size: 10px;
  }

  .input-currency-wrapper.with-inline-action input {
    padding-left: 154px !important;
  }
}

.segment-control {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.segment-control label {
  flex: 1;
  margin: 0;
  text-align: center;
  cursor: pointer;
  position: relative;
}

.segment-control input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.segment-control span {
  display: block;
  padding: 10px;
  background: var(--bg-color);
  border-left: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

.segment-control label:last-child span {
  border-left: none;
}

.segment-control input:checked + span {
  background-color: var(--primary-color);
  color: white;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-group label {
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.indented {
  margin-right: 24px;
  display: block;
  margin-top: 4px;
}

/* Tag Input Styles */
.input-tag-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.tags-input-container {
  flex-grow: 1;
  min-height: 36px;
  padding: 2px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--input-bg);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  transition: border-color 0.2s;
  min-width: 0; /* Allow flex child to shrink */
  max-width: 100%; /* Ensure it doesn't overflow */
}

.tags-input-container:focus-within {
  border-color: var(--input-focus-border);
}

.tag-item {
  background-color: var(--primary-color);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%; /* Prevent overflow */
}

.tag-item span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  display: inline-block;
  direction: ltr; /* Ensure URL truncates correctly at the end */
}

@media (max-width: 600px) {
  .tag-item span:first-child {
    max-width: 120px;
  }

  .tag-input {
    min-width: 60px; /* Allow input to shrink more on mobile */
  }

  .input-tag-wrapper {
    flex-wrap: wrap;
  }

  .tags-input-container {
    width: 100%;
  }

  .add-tag-btn {
    width: 100%;
    margin-top: 8px;
  }

  /* Disable default hover behavior on mobile to use JS modal instead */
  .info-icon:hover::before,
  .cpm-badge-static[data-title]:hover::after,
  .multiplier-badge:hover .tooltip {
    display: none !important;
  }

  /* Hide arrows on mobile */
  .info-icon:hover::after,
  .cpm-badge-static[data-title]:hover::before,
  .multiplier-badge:hover .tooltip::after {
    display: none !important;
  }
}

/* Mobile Tooltip Styles */
.mobile-tooltip-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1); /* Slight white tint */
  backdrop-filter: blur(4px); /* Blur effect */
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeInTooltip 0.2s forwards;
}

@keyframes fadeInTooltip {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.mobile-tooltip {
  background-color: rgba(30, 30, 30, 0.95);
  color: #fff;
  width: 85%;
  max-width: 320px;
  border-radius: 12px;
  padding: 20px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  transform: scale(0.9);
  animation: scaleInTooltip 0.2s forwards;
  overflow: hidden; /* For progress bar */
}

@keyframes scaleInTooltip {
  from {
    transform: scale(0.9);
  }
  to {
    transform: scale(1);
  }
}

.mobile-tooltip-title {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 8px;
  color: #3390ec; /* Telegram Blue */
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-tooltip-content {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
  white-space: pre-wrap; /* Preserve line breaks */
}

.mobile-tooltip-close {
  position: absolute;
  top: 8px;
  right: 12px; /* RTL layout, so right is actually start... wait, close usually top-right or top-left. Let's put top-left for Persian? No, X is usually top corner. */
  /* Let's stick to absolute visual positioning */
  left: 12px;
  right: auto;
  font-size: 20px;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
  padding: 4px;
}

.mobile-tooltip-timer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-tooltip-progress {
  height: 100%;
  background-color: #3390ec; /* Telegram Blue */
  width: 100%;
  /* Transition handled by JS or CSS animation */
}

.tag-remove {
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  line-height: 1;
  opacity: 0.8;
}

.tag-remove:hover {
  opacity: 1;
}

.tag-input {
  border: none !important;
  padding: 6px 8px !important;
  flex-grow: 1;
  min-width: 150px;
  background: transparent;
  height: 32px;
  width: 100%; /* Ensure it fills space but respects flex */
  max-width: 100%; /* Prevent overflow */
}

.tag-input:focus {
  box-shadow: none;
}

.add-tag-btn {
  padding: 0 12px;
  height: 36px;
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-color);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: all 0.2s;
  white-space: nowrap;
}

.add-tag-btn:hover {
  background-color: #e4e4e5;
}

.add-tag-btn.is-loading {
  position: relative;
  padding-right: 34px;
  cursor: wait;
  opacity: 0.9;
}

.add-tag-btn.is-loading::before {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid #9bb7d5;
  border-top-color: #2f8ff0;
  border-radius: 50%;
  animation: create-ad-add-tag-spin 0.75s linear infinite;
}

@keyframes create-ad-add-tag-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.dynamic-summary {
  margin-top: 12px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-color);
}

.dynamic-summary .icon {
  font-size: 18px;
  line-height: 1.2;
}

.icon.green {
  color: var(--success-color);
}

/* Preview Section */
.preview-section {
  padding-top: 20px;
}

.preview-container h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.preview-card-wrapper {
  background-image: url("../images/telegram-bg.png"); /* Local background */
  background-color: #99ba92; /* Fallback color */
  background-size: cover;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.preview-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  max-width: 320px;
  margin: 0 auto;
}

.preview-header {
  padding: 8px 12px;
  display: flex;
  align-items: center;
}

.preview-channel-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-avatar {
  width: 36px;
  height: 36px;
  background-color: #ccc;
  background-image: url("../images/placeholder.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 50%;
  flex-shrink: 0;
}

.channel-text {
  line-height: 1.2;
}

.channel-name {
  font-weight: 600;
  font-size: 14px;
}

.post-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.preview-content {
  padding: 0 12px 12px;
}

.preview-image-placeholder {
  width: 100%;
  height: 150px;
  background-color: #f0f2f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 14px;
}

.preview-image-placeholder img,
.preview-image-placeholder video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

#previewText {
  font-size: 15px;
  white-space: pre-wrap;
}

.preview-footer {
  padding: 8px 12px;
  border-top: 1px solid #f0f2f5;
}

.preview-cta-btn {
  width: 100%;
  background-color: #f5fcfeb5; /* Light blueish tint */
  color: var(--primary-color);
  border: none;
  padding: 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: "Vazirmatn", sans-serif;
}

/* Warnings */
.warnings {
  margin-top: 16px;
  font-size: 12px;
}

.warning-item {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.warning-item .icon {
  font-size: 16px;
  flex-shrink: 0;
}

.warning-item .icon.red {
  color: var(--danger-color);
}
.warning-item .icon.orange {
  color: var(--warning-color);
}

/* Bottom Actions */
.bottom-actions {
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terms-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.terms-checkbox label {
  margin-bottom: 0;
  cursor: pointer;
  font-weight: 500;
}

.terms-checkbox a {
  color: var(--primary-color);
  text-decoration: none;
}

.action-buttons {
  display: flex;
  gap: 16px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary-color);
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

/* Native Ad Preview Styles */
.native-ad-container {
  padding: 12px 16px;
  direction: ltr; /* Structural LTR */
  background-color: #f1f7fa; /* Light blue tint like Telegram */
  position: relative;
  border-radius: 0 10px 10px 0; /* Rounded right corners */
  min-height: 80px;
  display: flex;
  flex-direction: column;
}

/* Blue accent line on the left */
.preview-card.native-mode {
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  background-color: #f1f7fa;
  padding-left: 4px; /* Space for the blue line */
}

.preview-card.native-mode::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #3390ec;
  z-index: 1;
}

.native-ad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.native-ad-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.native-ad-label {
  color: #3390ec;
  font-weight: 500;
  font-size: 15px;
}

.native-ad-info {
  background-color: #ebf3f8;
  color: #6d7f8f; /* Darker grey-blue */
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: default;
  white-space: nowrap;
}

.native-ad-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 60%;
  justify-content: flex-end;
}

.native-ad-avatar {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background-color: #ccc;
  background-image: url("../images/placeholder.png");
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.native-ad-title {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  direction: rtl;
  opacity: 0.8;
}

.native-ad-text {
  font-size: 15px;
  color: #000;
  line-height: 1.5;
  white-space: pre-wrap;
  direction: rtl;
  text-align: right;
  margin-bottom: 12px;
  flex-grow: 1;
}

/* Adjustments for Native Mode Card */
.preview-card.native-mode .preview-header {
  display: none;
}

.preview-card.native-mode .preview-content {
  padding: 0; /* Remove default padding */
}

.preview-card.native-mode .preview-footer {
  border-top: 1px solid rgba(51, 144, 236, 0.15); /* Subtle separator */
  background-color: #f1f7fa; /* Match card bg */
  padding: 0;
  margin-left: 4px; /* Align with content past the blue line */
}

.preview-card.native-mode .preview-cta-btn {
  background-color: transparent;
  color: #3390ec;
  border-radius: 0;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  width: 100%;
  text-align: center;
  letter-spacing: 0.5px;
  font-family: "Vazirmatn", sans-serif !important; /* Force Vazir font */
}

.preview-card.native-mode .preview-cta-btn:hover {
  background-color: rgba(51, 144, 236, 0.08);
}

/* Media Upload Styles */
.media-upload-container {
  position: relative;
  width: 100%;
}

.media-preview-box {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background-color: #000;
  margin-bottom: 8px;
}

.media-content-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
}

.media-content-wrapper img,
.media-content-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* or contain based on preference, cover fills 16:9 */
}

.delete-media-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  z-index: 10;
}

.delete-media-btn:hover {
  background-color: rgba(229, 57, 53, 0.8);
}

.change-media-btn {
  width: 100%;
  padding: 10px;
  background-color: #3390ec;
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.change-media-btn:hover {
  background-color: #2883d9;
}

/* Search Preview Styles */
.preview-card-search {
  background: white;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  font-family: "Vazirmatn", sans-serif; /* Force Vazir for whole card */
  direction: ltr; /* Force LTR structure for search bar */
  margin: 0 auto; /* Center horizontally in flex container */
}

.search-bar-mock {
  background-color: #f1f1f1;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #707579;
  font-size: 15px;
  border-bottom: 1px solid #e4e4e4;
  direction: ltr; /* Ensure search bar is LTR */
}

.search-icon-mock {
  font-size: 16px;
}

.global-search-header {
  background-color: #f1f1f1;
  padding: 8px 16px;
  color: #707579;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  direction: ltr; /* Ensure header is LTR */
  text-align: left;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background-color: white;
  cursor: default;
  direction: rtl; /* Item content is RTL (Avatar right) */
}

.search-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #3390ec;
  margin-left: 12px;
  margin-right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
}

.search-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.search-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: right;
  align-items: flex-start;
}

.search-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  direction: ltr; /* Ad left, Title right */
}

.search-title {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  margin-bottom: 2px;
  direction: rtl;
  text-align: right;
  font-family: "Vazirmatn", sans-serif !important;
  /* Remove width 100% as it's now flex item */
}

.search-username {
  font-size: 14px;
  color: #aeb4b9;
  font-family: "Vazirmatn", sans-serif !important;
  direction: ltr;
  display: block; /* Block to take full width */
  text-align: right; /* Align right */
  width: 100%;
}

/* Remove old subtitle row styles if no longer used or keep for safety */
.search-subtitle-row {
  display: none;
}

/* Placeholder Item Styles */
.search-placeholder-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background-color: white;
  border-top: 1px solid #f0f0f0;
}

.search-placeholder-item.last {
  border-bottom: none; /* or remove if needed */
}

.placeholder-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #f1f1f1;
  margin-right: 12px;
  flex-shrink: 0;
}

.placeholder-lines {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.line-long {
  height: 8px;
  background-color: #f1f1f1;
  border-radius: 4px;
  width: 60%;
}

.line-short {
  height: 8px;
  background-color: #f1f1f1;
  border-radius: 4px;
  width: 40%;
}

/* Ad Badge Search Group */
.ad-badge-group-search {
  display: flex;
  align-items: center;
  justify-content: center; /* Center content horizontally */
  background-color: #ebf3f8;
  border-radius: 12px; /* Pill shape */
  padding: 0 5px; /* Increase horizontal padding */
  gap: 0;
  margin: 0;
  flex-shrink: 0;
  height: 18px; /* Fixed height */
  /* Remove position adjustments if aligned via flex */
}

.ad-badge-search-text {
  color: #3390ec;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding-top: 1px;
}

/* Dots removed */
.ad-badge-dots {
  display: none;
}

/* Empty State */
.preview-card-empty {
  width: 100%;
  height: 200px;
  background-color: #f5f5f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  text-align: center;
  padding: 20px;
  border: 1px dashed #ccc;
  font-size: 14px;
}

.search-placeholder-lines {
  padding: 10px 16px;
  opacity: 0.5;
}

.line {
  height: 10px;
  background-color: #f0f2f5;
  border-radius: 5px;
  margin-bottom: 10px;
}

.line.long {
  width: 85%;
}
.line.medium {
  width: 65%;
}
.line.short {
  width: 45%;
}
/* Bot Preview Styles */
.preview-card-bot {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  font-family: "Vazirmatn", sans-serif !important; /* Ensure Vazirmatn is applied */
  direction: ltr; /* Reset to LTR for layout structure */
}

.bot-preview-ad-area {
  padding: 12px 14px;
  background: white;
  border-bottom: 1px solid #f0f0f0;
}

.bot-ad-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.bot-ad-meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.bot-ad-badge {
  color: #3390ec;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.bot-ad-whats {
  color: #3390ec;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.bot-ad-meta-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.bot-ad-text {
  font-size: 12px;
  color: #1f2328;
  line-height: 1.35;
  white-space: pre-wrap;
  margin-top: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  display: block;
  text-align: start;
}

.bot-ad-title {
  font-size: 12px;
  font-weight: 700;
  color: #111;
  display: inline-block;
  min-width: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  direction: ltr;
  unicode-bidi: plaintext;
}

.bot-ad-avatar {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background-color: #ccc;
  background-image: url("../images/placeholder.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.bot-preview-chat-area {
  background-color: #a8d493;
  background-image: url("../images/telegram-bg.png");
  background-size: cover;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  direction: ltr;
}

.bot-chat-bubble {
  background: white;
  padding: 8px 12px;
  border-radius: 10px;
  position: relative;
  align-self: flex-start;
  max-width: 92%;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.bot-chat-text {
  font-size: 12px;
  color: #000;
  line-height: 1.4;
  font-family: "Vazirmatn", sans-serif;
}

.bot-chat-time {
  font-size: 10px;
  color: #8f98a1;
  text-align: right;
  margin-top: 2px;
}

.bot-start-btn {
  background-color: rgba(94, 137, 84, 0.72);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 17px;
  width: 100%;
  cursor: default;
  backdrop-filter: blur(2px);
  font-family: "Vazirmatn", sans-serif;
}

/* Responsive Design */
@media (max-width: 900px) {
  .creation-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .preview-section {
    order: 1; /* Show preview at the bottom on mobile */
    margin-top: 20px;
  }

  .target-channels-section {
    margin-top: 0; /* Reset margin since preview is below now */
  }
}

@media (max-width: 600px) {
  .app-container {
    padding-bottom: 80px;
  }

  .main-header {
    padding: 12px 16px;
    margin-bottom: 20px;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .logo-section {
    justify-content: center;
  }

  .user-section {
    justify-content: space-between;
    width: 100%;
    border-top: 1px solid var(--secondary-bg);
    padding-top: 12px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 24px;
  }

  .page-header h2 {
    justify-content: center;
  }

  .target-selector {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .target-selector .label {
    text-align: center;
    display: none; /* Hide label to save space if clear enough */
  }

  .tabs {
    width: 100%;
    display: flex;
  }

  .tab-btn {
    flex: 1;
    padding: 8px 4px;
    font-size: 13px;
    white-space: nowrap;
    text-align: center;
  }

  /* Form Elements */
  .form-group {
    margin-bottom: var(--form-row-gap);
  }

  input[type="text"],
  input[type="url"],
  input[type="number"],
  textarea {
    font-size: 14px; /* Prevent iOS zoom if we can, but user wants small. Let's try 14px */
    padding: 8px;
  }

  .segment-control label span {
    padding: 8px 4px;
    font-size: 13px;
  }

  /* Bottom Actions */
  .bottom-actions {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    margin-top: 24px;
  }

  .terms-checkbox {
    justify-content: center;
  }

  .action-buttons {
    flex-direction: column-reverse;
    gap: 12px;
    width: 100%;
  }

  .btn-primary,
  .btn-secondary,
  .btn-text {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
  }

  .btn-text {
    color: var(--text-secondary);
  }
}

/* Pricing Tooltip and Badge Styles */
.price-info-container {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.approx-value {
  position: static; /* Reset absolute positioning */
  color: var(--text-secondary);
  font-size: 13px;
}

.multiplier-badge {
  background-color: #fff3e0; /* Light orange bg */
  color: #e65100; /* Dark orange text */
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
}

.multiplier-badge:hover .tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

.tooltip {
  visibility: hidden;
  width: max-content;
  max-width: 240px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 12px;
  position: absolute;
  z-index: var(--z-tooltip);
  bottom: 135%; /* Position above */
  left: 50%;
  transform: translateX(-50%) translateY(0);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  white-space: normal;
  word-wrap: break-word;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%; /* At the bottom of the tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

/* Date Input Styles */
.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-suffix input {
  padding-right: 90px; /* Space for suffix */
}

.input-suffix {
  position: absolute;
  right: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  pointer-events: none;
  direction: ltr;
}

/* Ensure indented links align nicely */
.indented {
  margin-right: 24px;
  display: inline-block;
  margin-top: 4px;
}

/* Status & Date Picker Styling - Telegram Style */
.status-group {
  margin-bottom: 16px;
}

.radio-option-wrapper {
  margin-bottom: 8px;
}

.status-option-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.status-option-row .radio-label {
  margin-bottom: 0;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-color);
}

.radio-label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #c7d0db;
  border-radius: 50%;
  background: #fff;
  margin-left: 6px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.16s ease;
}

.radio-label input[type="radio"]:checked {
  border-color: var(--primary-color);
  background: radial-gradient(circle at center, var(--primary-color) 0 4px, #fff 4.5px);
}

.radio-label input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.22);
}

.radio-label input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.date-config-area {
  min-height: 18px;
  padding-top: 2px;
}

.status-option-row .date-config-area {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  margin-right: 0;
  text-align: right;
  padding-top: 0;
}

.status-option-row .date-config-area .set-date-link {
  margin-inline-start: 0;
}

.status-option-row .date-config-area .date-picker-box {
  width: 100%;
  margin-top: 6px;
}

.status-option-row .date-config-area.expanded {
  display: block;
  flex: 1 0 100%;
  margin-right: 24px;
  padding-top: 4px;
}

.set-date-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #cfe2fb;
  background: #eff6ff;
  transition: all 0.16s ease;
}

.set-date-link:hover {
  text-decoration: none;
  background: #e6f1ff;
  border-color: #bdd7f8;
}

@media (max-width: 680px) {
  .status-option-row .date-config-area.expanded {
    margin-right: 18px;
  }
}

.date-picker-box {
  margin-top: 8px;
  max-width: 100%;
  border: 1px solid #dfe5ef;
  border-radius: 10px;
  background: #f9fbfe;
  padding: 8px 10px;
}

.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
}

.picker-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.remove-date-link {
  color: #c62828;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #f5c6cd;
  background: #fff1f2;
  transition: all 0.16s ease;
}

.remove-date-link:hover {
  background: #ffe7ea;
  border-color: #efb5be;
}

.picker-input-container {
  position: relative;
  border: 1px solid #dfe1e5;
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 10px;
  height: 36px;
  transition: border-color 0.2s;
}

.picker-input-container:hover {
  border-color: #c4c7cc;
}

.picker-input-container:focus-within {
  border-color: #3390ec;
}

.styled-date-input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  direction: ltr; /* Date inputs are usually LTR */
  padding: 0 !important;
  color: var(--text-primary);
}

.timezone-badge {
  font-size: 13px;
  color: #707579;
  margin-left: 10px;
  white-space: nowrap;
  pointer-events: none;
}

/* Split Date/Time Picker Styling */
.picker-row {
  display: flex;
  gap: 8px;
}

.custom-input-container {
  position: relative;
  border: 1px solid #d9e1ec;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 8px;
  height: 34px;
  min-width: 0;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.custom-input-container:hover {
  border-color: #c5d1e0;
}

.custom-input-container:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(51, 144, 236, 0.14);
}

.date-container {
  flex: 1.4;
}

.time-container {
  flex: 1;
}

.real-input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  direction: ltr;
  padding: 0 !important;
  color: var(--text-primary);
  height: 100%;
}

.input-icon {
  font-size: 16px;
  color: #707579;
  margin-left: 8px;
  pointer-events: none;
}

.timezone-label {
  font-size: 13px;
  color: #707579;
  white-space: nowrap;
  margin-left: 8px;
  pointer-events: none;
}

/* Make the date input trigger clickable area */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0;
  /* We might want to keep the clock icon or hide it? 
       Telegram screenshot doesn't show a clock icon, just text.
    */
  display: none;
}

/* Updated Date Picker Icon Styles */
.input-icon {
  margin-left: 8px !important;
  margin-right: 2px;
  color: #707579;
  pointer-events: none;
  flex-shrink: 0; /* Don't squash icon */
  opacity: 0.72;
}

.custom-input-container .input-icon {
  width: 16px;
  height: 16px;
}

/* Hide timezone label as requested */
.timezone-label {
  display: none !important;
}

/* Ensure time input is centered or looks good without label */
.time-container input {
  text-align: center;
}

/* Adjust Date Container to accommodate icon better */
.date-container {
  padding-right: 14px; /* Balance padding */
}

/* Manual Date/Time Picker Styles */
.manual-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  direction: ltr; /* Ensure LTR order for date components */
  padding: 0 6px !important;
}

.date-select,
.time-select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0 2px;
  outline: none;
  cursor: pointer;
  text-align: center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  color: var(--text-primary);
}

.date-select:focus,
.time-select:focus {
  color: #3390ec;
}

.day-select {
  width: 32px;
}
.month-select {
  width: 82px;
}
.year-select {
  width: 50px;
}
.hour-select,
.minute-select {
  width: 32px;
}

.date-sep,
.time-sep {
  color: #aaa;
  margin: 0 1px;
  font-size: 12px;
  pointer-events: none;
}

/* Hide default select arrow */
.date-select::-ms-expand,
.time-select::-ms-expand {
  display: none;
}

/* Custom Select Styling */
.custom-select-wrapper {
  position: relative;
  user-select: none;
  display: inline-block;
  height: 100%;
}

.custom-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  cursor: pointer;
  height: 100%;
  white-space: nowrap;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.custom-select-trigger:hover {
  background-color: rgba(51, 144, 236, 0.08);
  color: #3390ec;
}

.custom-options {
  position: absolute;
  display: none;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 100%;
  width: max-content;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  z-index: 1000;
  padding: 6px 0;
  border: 1px solid #dfe1e5;
  scrollbar-width: thin;
}

.custom-options.open {
  display: block;
  animation: fadeIn 0.1s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.custom-option {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.custom-option:hover {
  background-color: #f5f5f5;
}

.custom-option.selected {
  color: #3390ec;
  font-weight: 600;
  background-color: rgba(51, 144, 236, 0.05);
}

/* Wrapper widths */
.custom-select-wrapper.day-select {
  min-width: 35px;
}
.custom-select-wrapper.month-select {
  min-width: 80px;
}
.custom-select-wrapper.year-select {
  min-width: 55px;
}
.custom-select-wrapper.hour-select,
.custom-select-wrapper.minute-select {
  min-width: 35px;
}

/* Fix Mobile Horizontal Scroll for Date Picker */
@media (max-width: 600px) {
  .picker-row {
    flex-direction: column; /* Stack vertically on mobile */
    gap: 10px;
  }

  .custom-input-container {
    width: 100%;
    flex: none; /* Disable flexbox resizing */
  }

  .date-container {
    padding-right: 12px; /* Reset padding for mobile */
  }

  /* Ensure custom selects don't overflow */
  .manual-picker {
    justify-content: space-between; /* Distribute space evenly */
    padding: 0 4px !important;
  }

  .custom-select-wrapper {
    flex: 1; /* Allow selects to take available space */
    min-width: auto; /* Allow shrinking if needed */
  }

  .custom-select-trigger {
    width: 100%;
    justify-content: center;
  }
}

/* Schedule Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: var(--z-modal);
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal.open {
  display: flex;
}

.modal-content {
  background-color: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 700px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 18px;
  margin: 0;
}

.modal-action-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

/* Schedule Grid */
.schedule-grid-container {
  overflow-x: auto;
  flex-grow: 1;
}

.schedule-grid {
  display: grid;
  grid-template-columns: 60px repeat(24, 1fr); /* Increased label width */
  gap: 3px;
  min-width: 650px; /* Ensure enough space */
  direction: rtl;
}

.schedule-header-row {
  display: contents;
}

.hour-header {
  font-size: 11px;
  text-align: center;
  color: var(--text-secondary);
  padding-bottom: 6px;
}

.day-label {
  font-size: 13px;
  color: var(--text-secondary);
  align-self: center;
  padding-left: 10px; /* Space from grid */
  white-space: nowrap;
  text-align: left;
}

.time-slot {
  height: 32px;
  background-color: #f0f2f5;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.1s;
  border: 1px solid transparent;
}

.time-slot:hover {
  background-color: #e4e4e5;
}

.time-slot.selected {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.time-slot.selected:hover {
  background-color: var(--primary-hover);
}

/* Selection helper overlay (optional) */
.schedule-grid {
  user-select: none;
}

.char-counter {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.char-counter.limit-reached {
  color: #e53935;
}

textarea#adText {
  transition: border-color 0.2s;
}

textarea#adText.limit-reached {
  border-color: #e53935;
  background-color: #fff8f8;
}

/* Mini Grid Preview */
.mini-schedule-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 1px; /* Creates the grid lines */
  height: 100px; /* Slightly taller */
  background-color: #e6e6e6; /* Grid line color */
  border: 1px solid #dfe1e5;
  border-radius: 8px;
  padding: 1px; /* Inner border for grid */
  margin-bottom: 12px;
  direction: ltr; /* Ensure 00 is on left */
  overflow: hidden;
}

.mini-slot {
  background-color: #fff; /* Inactive slot color */
}

.mini-slot.active {
  background-color: #3390ec; /* Active slot color */
}

.schedule-summary-text {
  font-size: 13px;
  color: var(--text-color);
  line-height: 1.6;
  text-align: left; /* Align summary to left for readability or match LTR logic of time ranges? */
  /* Persian text usually aligns right. But "00-01" is LTR. Mixed content. */
  /* Let's try right aligned for Persian app */
  text-align: right;
  margin-bottom: 8px;
  direction: rtl;
}

.emoji-helper {
  font-size: 12px;
  color: #707579;
  margin-top: 4px;
  line-height: 1.3;
}

.bot-link {
  color: #3390ec;
  text-decoration: none;
}

.bot-link:hover {
  text-decoration: underline;
}

.tutorial-link {
  color: #3390ec;
  cursor: pointer;
  margin-right: 5px;
  font-weight: 500;
}

.tutorial-link:hover {
  text-decoration: underline;
}

/* Emoji tutorial modal (scoped to avoid global modal collisions) */
#emojiModal.modal {
  display: none;
  position: fixed;
  z-index: var(--z-modal);
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
}

#emojiModal .modal-content {
  background-color: #fff;
  margin: auto;
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-modal {
  color: #aaa;
  float: left; /* Left side because RTL */
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 20px;
}

.close-modal:hover,
.close-modal:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.video-placeholder {
  width: 100%;
  height: 250px;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin: 16px 0;
  color: #888;
}

.modal-desc {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}
.similar-targets-wrapper {
  margin-top: 12px;
}

.similar-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.similar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3390ec; /* Telegram blue */
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  user-select: none;
  direction: rtl;

  /* Pill Style Improvements - Enhanced Visibility */
  padding: 8px 16px; /* Increased padding */
  border-radius: 8px; /* Less rounded, more like a button */
  border: 1px solid rgba(51, 144, 236, 0.3); /* Visible border */
  background-color: transparent;
  line-height: 1.5; /* Ensure consistent text height */
}

.similar-link .icon-state {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3390ec;
  transition: color 0.2s;
  height: 20px; /* Explicit height to match icon */
  width: 20px; /* Explicit width */
}

.similar-link:hover {
  background-color: rgba(51, 144, 236, 0.08); /* Subtle blue hover */
  border-color: rgba(51, 144, 236, 0.5);
}

.similar-link:hover .icon-state {
  color: #2883d9;
}

/* Active State (Selected) */
.similar-link.active {
  background-color: #f0f7fd; /* Light blue background */
  border-color: #3390ec; /* Solid blue border */
  font-weight: 600; /* Bolder text */
  box-shadow: 0 1px 2px rgba(51, 144, 236, 0.15); /* Subtle shadow */
}

.similar-link.active .icon-state {
  color: #3390ec;
}

.arrow-icon,
.check-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.similar-info {
  margin-right: 4px;
  cursor: help;
  font-size: 14px;
  color: #8e8e93;
}

/* Dashboard Empty State */
.dashboard-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px); /* Minus header height approx */
  background-color: var(--bg-color);
}

.empty-state-container {
  text-align: center;
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-state-icon {
  width: 100px;
  height: 100px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.empty-state-icon svg {
  width: 50px;
  height: 50px;
}

.empty-state-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 12px;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
  text-align: center;
}

.empty-state-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.empty-state-actions .btn-primary {
  min-width: 200px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  padding: 12px 24px;
}

.custom-alert-modal {
  z-index: calc(var(--z-modal) + 100);
  padding: 10px;
}

.custom-alert-modal .custom-alert-content {
  width: min(92vw, 360px);
  max-width: 360px;
  text-align: center;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: customAlertIn 0.2s ease-out;
}

.custom-alert-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff3f2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

#customAlertTitle {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-color);
}

#customAlertMessage {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.custom-alert-btn {
  width: 100%;
  min-height: 40px;
  font-size: 14px;
}

.custom-confirm-content {
  max-width: 390px;
}

.custom-confirm-icon {
  background: #edf5ff;
}

#customConfirmTitle {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-color);
}

#customConfirmMessage {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.custom-confirm-actions {
  width: 100%;
  display: flex;
  gap: 10px;
}

.custom-confirm-btn {
  flex: 1;
  min-height: 40px;
  font-size: 14px;
  border-radius: 11px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}

.custom-confirm-ok-btn {
  background: var(--primary-color);
  color: #fff;
}

.custom-confirm-ok-btn:hover {
  filter: brightness(0.96);
}

.custom-confirm-cancel-btn {
  background: #f3f5f8;
  color: var(--text-color);
  border-color: #d7dee8;
}

.custom-confirm-cancel-btn:hover {
  background: #e9edf3;
  border-color: #cfd7e3;
}

@keyframes customAlertIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Channel Icon Preview in Input */
.channel-icon-preview {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #f0f2f5;
  background-size: cover;
  background-position: center;
  z-index: 6;
  border: 1px solid var(--border-color);
  pointer-events: none;
  transition: all 0.2s ease;
}

/* When icon is visible, add padding to input */
.form-group.has-channel-icon input#adUrl {
  padding-left: 48px !important;
}

/* Global Pagination */
.app-pagination-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Shared filter chips (used in dashboard/budget and future list filters) */
.transaction-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.filter-btn {
  padding: 5px 11px;
  border-radius: 10px;
  background-color: #ffffff;
  color: #6f7782;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid #dce1e7;
}

.filter-btn:hover {
  background-color: #f7f9fb;
  border-color: #cdd5de;
  color: var(--text-color);
}

.filter-btn.active {
  background-color: #eaf4ff;
  color: #1e7ed9;
  border-color: #9cc9f4;
}

.app-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
  flex-wrap: wrap;
}

.app-pagination-summary {
  font-size: 12px;
  color: #66707c;
  white-space: nowrap;
}

.app-pagination-sep {
  margin: 0 4px;
  color: #a0a8b1;
}

.app-pagination-links {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.app-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 30px;
  text-decoration: none;
  border: 1px solid #d7dee6;
  background: #fff;
  color: #384555;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  font-family: inherit;
}

.app-pagination-btn:hover {
  background: #f6f9fc;
  border-color: #c8d2de;
}

.app-pagination-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.app-pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.app-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-pagination-label {
  font-size: 12px;
  color: #6c7683;
  font-weight: 600;
  line-height: 1;
}

.app-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: 32px;
  border: 1px solid #d3dde9;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%236d7f95' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: left 9px center;
  background-size: 12px 12px;
  background-repeat: no-repeat;
  border-radius: 8px;
  padding: 0 9px 0 30px;
  color: #32455f;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.app-select:hover {
  border-color: #c8d2de;
  background-color: #fdfefe;
}

.app-select::-ms-expand {
  display: none;
}

.app-select:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.14);
}

.app-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-select option {
  font-family: inherit;
  font-size: 12px;
}

.app-pagination-select {
  min-width: 72px;
  width: auto;
  font-variant-numeric: tabular-nums;
  text-align-last: right;
}

.app-pagination-select option {
  text-align: right;
}

.app-select.is-enhanced-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}

.app-custom-select {
  position: relative;
  min-width: 72px;
}

.app-custom-select-trigger {
  width: 100%;
  min-width: 72px;
  height: 32px;
  border: 1px solid #d3dde9;
  background: #fff;
  border-radius: 8px;
  color: #32455f;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.app-custom-select-trigger:hover {
  border-color: #c8d2de;
  background: #fdfefe;
}

.app-custom-select-trigger:focus-visible {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.14);
}

.app-custom-select.is-open .app-custom-select-trigger {
  border-color: #b8cee9;
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.12);
}

.app-custom-select-value {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.app-custom-select-arrow {
  display: block;
  width: 9px;
  height: 9px;
  border-right: 1.6px solid #72839a;
  border-bottom: 1.6px solid #72839a;
  position: relative;
  top: -1px;
  transform-origin: center;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.app-custom-select.is-open .app-custom-select-arrow {
  transform: translateY(-1px) rotate(-135deg);
}

.app-custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: var(--z-dropdown);
  border: 1px solid #d5e0ed;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(26, 51, 82, 0.14);
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  display: none;
}

.app-custom-select.is-open .app-custom-select-menu {
  display: block;
}

.app-custom-select-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: #39506d;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  min-height: 30px;
  border-radius: 7px;
  padding: 0 8px;
  text-align: right;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.app-custom-select-option:hover {
  background: #f3f8fe;
}

.app-custom-select-option.is-selected {
  background: #eaf4ff;
  color: #1f7ed9;
  font-weight: 700;
}

.app-custom-select.is-disabled .app-custom-select-trigger {
  opacity: 0.6;
  cursor: not-allowed;
}

/* User Announcements */
.app-announcement-banner,
.app-announcement-modal {
  --announcement-accent: #2f8fe8;
  --announcement-accent-hover: #2375c0;
  --announcement-accent-text: #ffffff;
  --announcement-card-border: #d6e3f2;
  --announcement-card-bg: #f7fbff;
  --announcement-close-border: #cfdaea;
  --announcement-close-bg: #ffffff;
  --announcement-close-color: #6b7d92;
}

.app-announcement-banner {
  border: 1px solid var(--announcement-card-border);
  border-radius: 14px;
  background: var(--announcement-card-bg);
  box-shadow: 0 10px 24px rgba(34, 64, 98, 0.1);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  padding-left: 46px;
  position: relative;
  overflow: hidden;
}

.app-announcement-banner::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  right: 0;
  width: 4px;
  border-radius: 3px;
  background: var(--announcement-accent);
  opacity: 0.26;
}

.app-announcement-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
}

.app-announcement-message-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-top: 4px;
}

.app-announcement-body {
  min-width: 0;
  padding-right: 6px;
}

.app-announcement-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #1f334b;
  line-height: 1.5;
  flex: 1 1 auto;
  min-width: 0;
}

.app-announcement-message {
  margin: 0;
  font-size: 12px;
  color: #5c6f84;
  line-height: 1.7;
  flex: 0 1 auto;
  min-width: 0;
}

.app-announcement-message-row .app-announcement-cta {
  margin-top: 0;
}

.app-announcement-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.app-announcement-cta {
  text-decoration: none;
  border: 1px solid var(--announcement-accent);
  border-radius: 9px;
  background: var(--announcement-accent);
  color: var(--announcement-accent-text);
  padding: 4px 9px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.app-announcement-cta:hover {
  background: var(--announcement-accent-hover);
  border-color: var(--announcement-accent-hover);
  color: var(--announcement-accent-text);
}

.app-announcement-close {
  border: 1px solid var(--announcement-close-border);
  background: var(--announcement-close-bg);
  color: var(--announcement-close-color);
  border-radius: 9px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.app-announcement-close:hover {
  border-color: var(--announcement-accent);
  color: var(--announcement-accent);
}

.app-announcement-banner > .app-announcement-close {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  z-index: 2;
}

.app-announcement-close svg {
  width: 14px;
  height: 14px;
  display: block;
}

.app-announcement-slot-top {
  width: min(1000px, calc(100% - 24px));
  margin: 10px auto 14px;
}

.app-announcement-slot-sticky-top {
  width: min(1000px, calc(100% - 24px));
  margin: 8px auto 14px;
  position: relative;
  z-index: var(--z-toast);
}

.app-announcement-slot-sticky-top.is-floating {
  position: fixed;
  right: 50%;
  transform: translateX(50%);
  margin: 0;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
}

.app-announcement-slot-bottom {
  position: fixed;
  right: 50%;
  transform: translateX(50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  width: min(1000px, calc(100% - 24px));
  z-index: var(--z-toast);
}

.app-announcement-modal-backdrop.modal {
  z-index: calc(var(--z-modal) + 100);
  padding: 10px;
}

.app-announcement-modal.modal-content {
  width: min(92vw, 390px);
  max-width: 390px;
  border: 1px solid var(--announcement-card-border);
  border-radius: 14px;
  background: var(--announcement-card-bg);
  box-shadow: 0 18px 44px rgba(18, 36, 57, 0.24);
  padding: 0;
  overflow: auto;
  max-height: min(88vh, 760px);
  overscroll-behavior: contain;
  text-align: right;
}

.app-announcement-modal-head {
  padding: 14px 18px 10px;
  border-bottom: 1px solid #e5edf6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.app-announcement-modal-head .app-announcement-close {
  position: absolute;
  left: 14px;
  top: 10px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.app-announcement-modal-body {
  padding: 12px 18px 18px;
  display: grid;
  gap: 12px;
}

.app-announcement-modal-body .app-announcement-message {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.85;
}

.app-announcement-modal-actions {
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 8px;
}

.app-announcement-modal-actions .app-announcement-cta {
  width: 100%;
  min-height: 38px;
  font-size: 13px;
  border-radius: 10px;
}

.app-announcement-media {
  border: 1px solid #d7e3f2;
  border-radius: 12px;
  overflow: hidden;
  background: #edf3fb;
}

.app-announcement-media img,
.app-announcement-media video {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(52vh, 360px);
  object-fit: contain;
  background: #e9f0f8;
}

.app-announcement--brand {
  --announcement-card-border: #b8d8f8;
  --announcement-card-bg: linear-gradient(135deg, #eef6ff 0%, #e5f1ff 100%);
  --announcement-accent: #2b87de;
  --announcement-accent-hover: #216fb8;
  --announcement-close-border: #bfd8f4;
  --announcement-close-color: #3a638d;
}

.app-announcement--info {
  --announcement-card-border: #d2e2f5;
  --announcement-card-bg: #f7fbff;
  --announcement-accent: #2f8fe8;
  --announcement-accent-hover: #2375c0;
  --announcement-close-border: #c9dbee;
  --announcement-close-color: #5f758d;
}

.app-announcement--success {
  --announcement-card-border: #c9e6d4;
  --announcement-card-bg: #f3fbf6;
  --announcement-accent: #2e9e57;
  --announcement-accent-hover: #258348;
  --announcement-close-border: #c7e2d1;
  --announcement-close-color: #4b7b5f;
}

.app-announcement--warning {
  --announcement-card-border: #efdcb4;
  --announcement-card-bg: #fff9ee;
  --announcement-accent: #b87916;
  --announcement-accent-hover: #955f0c;
  --announcement-close-border: #e9d7b1;
  --announcement-close-color: #84602a;
}

.app-announcement--danger {
  --announcement-card-border: #efcdcd;
  --announcement-card-bg: #fff5f5;
  --announcement-accent: #cf4a4a;
  --announcement-accent-hover: #b63a3a;
  --announcement-close-border: #e9cdcd;
  --announcement-close-color: #8f5b5b;
}

.app-announcement--neutral {
  --announcement-card-border: #d8e0ea;
  --announcement-card-bg: #f8fafc;
  --announcement-accent: #5f6f81;
  --announcement-accent-hover: #4c5b6d;
  --announcement-close-border: #d4dde8;
  --announcement-close-color: #5f6f84;
}

.app-maintenance-strip {
  width: min(1000px, calc(100% - 24px));
  margin: 10px auto 0;
}

.app-maintenance-notices {
  display: grid;
  gap: 8px;
}

.app-maintenance-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #d5e1f1;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f7fbff;
}

.app-maintenance-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f8fe8;
  margin-top: 6px;
  flex: 0 0 auto;
}

.app-maintenance-copy {
  min-width: 0;
}

.app-maintenance-copy strong {
  display: block;
  margin: 0 0 1px;
  font-size: 12px;
  font-weight: 800;
  color: #23405f;
  line-height: 1.45;
}

.app-maintenance-copy p {
  margin: 0;
  font-size: 11.5px;
  color: #5f738c;
  line-height: 1.65;
}

.app-maintenance-notice.tone-warning {
  border-color: #e8d4aa;
  background: #fff9ef;
}

.app-maintenance-notice.tone-warning .app-maintenance-dot {
  background: #b87916;
}

.app-maintenance-notice.tone-warning .app-maintenance-copy strong {
  color: #7b571e;
}

.app-maintenance-notice.tone-warning .app-maintenance-copy p {
  color: #8c6a35;
}

.app-maintenance-notice.tone-danger {
  border-color: #e8cbcb;
  background: #fff5f5;
}

.app-maintenance-notice.tone-danger .app-maintenance-dot {
  background: #cf4a4a;
}

.app-maintenance-notice.tone-danger .app-maintenance-copy strong {
  color: #8b3737;
}

.app-maintenance-notice.tone-danger .app-maintenance-copy p {
  color: #9a5959;
}

@media (max-width: 600px) {
  .app-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .app-pagination-summary {
    white-space: normal;
    text-align: center;
  }

  .app-pagination-links {
    justify-content: center;
  }

  .app-pagination-controls {
    width: 100%;
    justify-content: space-between;
  }

  .app-maintenance-strip {
    width: calc(100% - 16px);
    margin-top: 8px;
  }

  .app-maintenance-notices {
    gap: 6px;
  }

  .app-maintenance-notice {
    border-radius: 9px;
    padding: 7px 8px;
    gap: 7px;
  }

  .app-maintenance-dot {
    width: 7px;
    height: 7px;
    margin-top: 5px;
  }

  .app-maintenance-copy strong {
    font-size: 11.5px;
  }

  .app-maintenance-copy p {
    font-size: 11px;
    line-height: 1.6;
  }

  .app-announcement-banner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    padding: 9px 10px;
    padding-left: 42px;
  }

  .app-announcement-banner::before {
    top: 8px;
    bottom: 8px;
    width: 3px;
  }

  .app-announcement-body {
    padding-right: 2px;
  }

  .app-announcement-title {
    font-size: 13px;
    line-height: 1.45;
  }

  .app-announcement-message {
    font-size: 11.5px;
    line-height: 1.65;
  }

  .app-announcement-message-row {
    gap: 5px;
    margin-top: 3px;
  }

  .app-announcement-actions {
    width: auto;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 6px;
  }

  .app-announcement-banner.has-cta .app-announcement-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .app-announcement-cta {
    width: auto;
    min-height: 26px;
    text-align: center;
    justify-content: center;
    padding: 3px 8px;
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
    max-width: 90px;
  }

  .app-announcement-close {
    width: 27px;
    height: 27px;
  }

  .app-announcement-banner > .app-announcement-close {
    top: 6px;
    left: 6px;
  }

  .app-announcement-slot-top {
    width: calc(100% - 16px);
    margin: 6px auto 10px;
  }

  .app-announcement-slot-sticky-top {
    width: calc(100% - 16px);
    margin: 4px auto 10px;
  }

  .app-announcement-slot-sticky-top.is-floating {
    top: calc(env(safe-area-inset-top, 0px) + 4px);
  }

  .app-announcement-slot-bottom {
    width: calc(100% - 16px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  }

  .app-announcement-modal-backdrop.modal {
    padding: 12px;
  }

  .app-announcement-modal.modal-content {
    width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 14px;
  }

  .app-announcement-modal-head {
    padding: 12px 12px 8px;
  }

  .app-announcement-modal-head .app-announcement-close {
    left: 10px;
    top: 8px;
    width: 30px;
    height: 30px;
  }

  .app-announcement-modal-body {
    padding: 10px 12px 12px;
  }

  .app-announcement-media img,
  .app-announcement-media video {
    max-height: 42vh;
  }
}
