/*
 * Global compact design system
 * This file is loaded after all page styles and acts as the density baseline.
 */

:root {
  --radius: 6px;
  --spacing: 12px;
  --form-label-gap: 3px;
  --form-row-gap: 12px;
  --form-floating-row-gap: 16px;
  --form-stack-row-gap: 12px;
  --form-section-gap: 24px;
  --form-meta-gap: 4px;
  --form-meta-gap-lg: 8px;
}

body {
  font-size: 14px;
  line-height: 1.45;
}

.app-container {
  max-width: 1120px;
  padding-bottom: 36px;
}

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

.header-content,
.main-content {
  max-width: 940px;
}

.main-content {
  padding: 0 16px;
}

.logo-section h1 {
  font-size: 14px;
}

.page-header {
  margin-bottom: 18px;
}

.page-header h2 {
  font-size: 18px;
}

h1,
h2,
h3 {
  line-height: 1.35;
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select {
  font-size: 13px;
}

textarea {
  min-height: 44px;
}

label {
  font-size: 12px;
  margin-bottom: var(--form-label-gap);
}

.form-group {
  margin-bottom: var(--form-row-gap);
}

.segment-control {
  border-radius: 10px;
  border-color: #d6dee9;
  background: #f6f8fc;
  padding: 2px;
  gap: 2px;
}

.segment-control label {
  min-width: 0;
}

.segment-control span {
  padding: 7px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6f7783;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.segment-control input:not(:checked) + span:hover {
  background: #ffffff;
  color: var(--text-color);
}

.segment-control input:focus-visible + span {
  outline: 2px solid rgba(24, 136, 218, 0.28);
  outline-offset: 1px;
}

.segment-control input:checked + span {
  box-shadow: 0 1px 2px rgba(24, 136, 218, 0.28);
}

.helper-text,
.form-note,
.error-message {
  font-size: 11px;
}

.checkbox-group {
  gap: 8px;
}

.checkbox-group input[type="checkbox"],
.terms-checkbox input[type="checkbox"],
.radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
}

.checkbox-group input[type="checkbox"]:checked,
.terms-checkbox input[type="checkbox"]:checked {
  background-size: 10px 10px;
}

.status-group .set-date-link,
.status-group .remove-date-link {
  font-size: 11px;
  padding: 3px 9px;
}

.status-group .date-picker-box {
  padding: 7px 8px;
  border-radius: 9px;
}

.status-group .picker-header {
  font-size: 11px;
  margin-bottom: 6px;
}

.status-group .custom-input-container {
  height: 32px;
  border-radius: 8px;
  padding: 0 6px;
}

.status-group .date-select,
.status-group .time-select,
.status-group .date-sep,
.status-group .time-sep {
  font-size: 11px;
}

.status-group .custom-input-container .input-icon {
  width: 14px;
  height: 14px;
  margin-left: 6px !important;
}

.btn-primary,
.upload-btn,
.auth-btn,
.btn-save-info,
.payment-btn,
.dashboard-create-btn {
  font-size: 13px;
  border-radius: 9px;
  padding: 8px 14px;
}

.header-create-btn {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 12px;
}

.dashboard-create-btn {
  gap: 6px;
}

.avatar,
.dropdown-user-info .avatar-small {
  width: 28px;
  height: 28px;
}

.user-trigger-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.user-trigger-icon svg {
  width: 14px;
  height: 14px;
}

.dropdown-items a,
.budget-link,
.dropdown-user-info .username-small {
  font-size: 13px;
}

.dropdown-user-label {
  font-size: 10px;
}

.budget-link {
  gap: 3px;
}

.budget-plus-icon {
  width: 12px;
  height: 12px;
}

.budget-plus-icon svg {
  width: 12px;
  height: 12px;
}

.account-summary-card,
.personal-info-card,
.charge-wallet-container,
.current-budget-card {
  padding: 16px;
  border-radius: 10px;
}

.section-title,
.info-section-title {
  font-size: 14px;
  margin-bottom: 12px;
}

.info-container {
  max-width: 560px;
}

.account-header-box {
  padding: 12px;
}

.account-avatar {
  width: 48px;
  height: 48px;
  margin-left: 12px;
}

.account-name {
  font-size: 14px;
}

.account-type {
  font-size: 12px;
}

.tg-input {
  height: 46px;
  font-size: 14px;
  padding: 12px 14px;
}

.tg-input:focus {
  padding: 11px 13px;
}

.tg-label {
  font-size: 12px;
}

.btn-save-info {
  padding: 11px;
  font-size: 14px;
}

.budget-tabs {
  gap: 16px;
  margin-bottom: 16px;
}

.budget-tab-link {
  font-size: 13px;
  padding-bottom: 9px;
}

.budget-overview-row {
  gap: 16px;
  margin-bottom: 24px;
}

.budget-amount-large {
  font-size: 24px;
}

.currency-symbol {
  font-size: 14px;
}

.budget-label,
.trans-desc,
.trans-amount {
  font-size: 13px;
}

.trans-date {
  font-size: 12px;
}

.transaction-item {
  padding: 12px;
}

.payment-methods-grid {
  gap: 10px;
}

.payment-btn {
  padding: 10px 12px;
}

.input-with-currency input {
  font-size: 14px;
  padding: 10px 12px;
  padding-left: 52px;
}

.currency-suffix {
  left: 12px;
  font-size: 12px;
}

.quick-amount-btn {
  font-size: 11px;
  padding: 5px 10px;
}

.payment-gateways-row {
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 16px;
}

.gateway-option {
  gap: 4px;
  padding: 9px 8px;
  min-height: 74px;
  border-width: 1px;
  border-radius: 10px;
  background-color: #fbfcfe;
}

.gateway-option.selected {
  background-color: #eef6ff;
  border-color: #7eb8f2;
}

.gateway-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 0;
}

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

.gateway-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.pay-action-btn {
  padding: 10px;
  font-size: 14px;
}

.creation-layout {
  gap: 24px;
}

.preview-section {
  padding-top: 12px;
}

.preview-container h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.preview-card-wrapper {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.preview-card,
.preview-card-bot {
  max-width: 286px;
  border-radius: 10px;
}

.preview-card-search {
  max-width: 332px;
  border-radius: 10px;
}

.preview-header {
  padding: 6px 10px;
}

.preview-channel-info {
  gap: 8px;
}

.channel-avatar {
  width: 30px;
  height: 30px;
}

.channel-name {
  font-size: 13px;
}

.post-meta {
  font-size: 11px;
}

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

.preview-image-placeholder {
  height: 122px;
  margin-bottom: 6px;
  font-size: 12px;
}

#previewText {
  font-size: 13px;
  line-height: 1.45;
}

.preview-footer {
  padding: 6px 10px;
}

.preview-cta-btn {
  padding: 7px;
  font-size: 12px;
  border-radius: 6px;
}

.native-ad-container {
  min-height: 66px;
  padding: 9px 12px;
}

.native-ad-header {
  margin-bottom: 4px;
}

.native-ad-label {
  font-size: 13px;
}

.native-ad-info {
  font-size: 10px;
  padding: 1px 5px;
}

.native-ad-avatar {
  width: 34px;
  height: 34px;
  border-radius: 5px;
}

.native-ad-title {
  font-size: 12px;
}

.native-ad-text {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.preview-card.native-mode .preview-cta-btn {
  padding: 9px;
  font-size: 12px;
}

.search-bar-mock {
  padding: 8px 12px;
  gap: 8px;
  font-size: 13px;
}

.global-search-header {
  padding: 6px 12px;
  font-size: 11px;
}

.search-result-item {
  padding: 8px 12px;
}

.search-avatar,
.placeholder-avatar {
  width: 36px;
  height: 36px;
}

.search-avatar {
  margin-left: 8px;
}

.search-title {
  font-size: 13px;
  margin-bottom: 1px;
}

.search-username {
  font-size: 12px;
}

.ad-badge-group-search {
  height: 16px;
  border-radius: 10px;
}

.ad-badge-search-text {
  font-size: 10px;
}

.search-placeholder-item {
  padding: 8px 12px;
}

.placeholder-lines {
  gap: 5px;
}

.line-long,
.line-short {
  height: 6px;
}

.preview-card-empty {
  height: 158px;
  font-size: 12px;
  padding: 12px;
}

.bot-preview-ad-area {
  padding: 9px 12px;
}

.bot-ad-meta-row {
  gap: 6px;
}

.bot-ad-meta-left {
  gap: 5px;
}

.bot-ad-meta-right {
  gap: 5px;
}

.bot-ad-badge {
  font-size: 11px;
}

.bot-ad-whats {
  font-size: 10px;
}

.bot-ad-text {
  font-size: 11px;
  line-height: 1.3;
  margin-top: 5px;
}

.bot-ad-title {
  font-size: 11px;
  max-width: 96px;
}

.bot-ad-avatar {
  width: 30px;
  height: 30px;
  border-radius: 5px;
}

.bot-preview-chat-area {
  padding: 10px;
  gap: 8px;
}

.bot-chat-bubble {
  padding: 6px 9px;
}

.bot-chat-text {
  font-size: 12px;
}

.bot-chat-time {
  font-size: 10px;
}

.bot-start-btn {
  padding: 9px;
  font-size: 13px;
  border-radius: 7px;
}

.tabs {
  padding: 3px;
}

.tab-btn {
  font-size: 13px;
  padding: 5px 12px;
}

.floating-group {
  margin-bottom: var(--form-floating-row-gap);
}

.floating-group label,
.floating-label {
  font-size: 12px;
}

.input-currency-wrapper input,
.cpm-fake-input-wrapper {
  height: 44px;
}

.auth-page {
  padding: 14px;
}

.auth-card {
  max-width: 840px;
  min-height: 500px;
  border-radius: 18px;
}

.auth-visual-side {
  padding: 30px;
}

.visual-text {
  font-size: 14px;
}

.auth-form-side {
  padding: 42px;
}

.auth-header {
  margin-bottom: 26px;
}

.auth-header h1 {
  font-size: 18px;
}

.input-label,
.auth-floating-group .floating-label {
  font-size: 13px;
}

.auth-input {
  height: 44px;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 10px;
}

.auth-btn {
  padding: 11px;
  font-size: 14px;
}

.dashboard-populated {
  padding: 14px 0;
}

.dashboard-header {
  margin-bottom: 10px;
}

.dashboard-title {
  font-size: 18px;
}

.table-responsive {
  padding: 0 12px;
}

.ads-table {
  border-spacing: 0 4px;
}

.ads-table th {
  font-size: 12px;
  padding: 0 8px 6px;
}

.ads-table td {
  font-size: 12px;
  padding: 8px;
}

.ad-title {
  font-size: 13px;
}

.ad-text-preview {
  font-size: 11px;
  max-width: 180px;
}

.status-badge {
  font-size: 12px;
}

.app-pagination-summary,
.app-pagination-label {
  font-size: 11px;
}

.app-pagination-btn {
  min-height: 28px;
  min-width: 30px;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 7px;
}

.app-select {
  height: 30px;
  border-radius: 7px;
  font-size: 11px;
  background-size: 11px 11px;
  background-position: left 8px center;
  padding-left: 27px;
}

.app-select option {
  font-size: 11px;
}

.app-pagination-select {
  min-width: 68px;
}

.app-custom-select-trigger {
  min-width: 68px;
  height: 30px;
  border-radius: 7px;
  font-size: 11px;
}

.app-custom-select-option {
  min-height: 28px;
  border-radius: 6px;
  font-size: 11px;
}

.menu-trigger svg {
  width: 18px;
  height: 18px;
}

.col-actions {
  width: 66px;
}

@media (max-width: 900px) {
  .auth-card {
    max-width: 440px;
    min-height: auto;
  }

  .auth-form-side {
    padding: 28px;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 0 10px;
  }

  .table-responsive {
    overflow-x: auto;
    padding: 0 6px;
  }

  .ads-table {
    min-width: 700px;
    table-layout: auto;
  }
}

@media (max-width: 600px) {
  .preview-section {
    padding-top: 8px;
  }

  .preview-card,
  .preview-card-bot,
  .preview-card-search {
    max-width: 100%;
  }

  .preview-card-wrapper {
    padding: 10px;
  }

  .preview-image-placeholder {
    height: 114px;
  }

  .native-ad-container {
    padding: 8px 10px;
  }

  .search-bar-mock {
    padding: 7px 10px;
  }

  .search-result-item,
  .search-placeholder-item {
    padding: 7px 10px;
  }

  .bot-preview-ad-area {
    padding: 8px 10px;
  }

  .bot-preview-chat-area {
    padding: 9px;
  }

  .payment-gateways-row {
    gap: 8px !important;
  }

  .gateway-option {
    padding: 9px 12px !important;
    min-height: 54px;
    gap: 8px !important;
  }

  .gateway-icon {
    width: 20px !important;
    height: 20px !important;
  }

  .gateway-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .gateway-name {
    font-size: 12px;
  }
}

/* Prevent iOS auto-zoom on focus for typed inputs (Safari/Chrome on iPhone) */
@supports (-webkit-touch-callout: none) {
  @media (hover: none) and (pointer: coarse) {
    input[type="text"],
    input[type="url"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    textarea {
      font-size: 16px !important;
    }
  }
}
