/*!*****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./src/app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************/
/* ============================================================================ */
/* ГЛОБАЛЬНЫЕ СТИЛИ - ЛеньТюлень                                               */
/* ============================================================================ */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/work-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/work-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

button,
a,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-x: hidden;
  max-width: 100%;
  height: 100%;
  background: var(--app-gradient);
  text-size-adjust: 100%;
}

/* Фиксированная высота для iOS Safari */
@supports (-webkit-touch-callout: none) {
  html {
    height: -webkit-fill-available;
  }
}


:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --success: #06d6a0;
  --danger: #ef476f;
  --warning: #ffd166;
  --light: #f8f9fa;
  --dark: #212529;
  --border: #dee2e6;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --app-height: 100vh;
  --modal-side-padding: 20px;
  --app-gradient:
    radial-gradient(circle at 12% 12%, rgba(255, 170, 120, 0.35), transparent 45%),
    radial-gradient(circle at 88% 18%, rgba(110, 169, 238, 0.25), transparent 40%),
    linear-gradient(120deg, #f6efe5, #e9f2ff 60%, #f8efe7);
  /* View Transitions */
  view-transition-name: root;
}

@supports (height: 100svh) {
  :root {
    --app-height: 100svh;
  }
}

@supports (height: 100dvh) {
  :root {
    --app-height: 100dvh;
  }
}

/* Smooth Page Transitions */
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body > * {
  animation: pageEnter 0.3s ease-out;
}

/* Font Awesome Icons */
i.fas, i.far, i.fab {
  margin-right: 6px;
}

button i, .toast i {
  margin-right: 4px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--app-gradient);
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden;
  text-size-adjust: 100%;
}

select {
  color: inherit;
  -webkit-text-fill-color: currentColor;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
}

select:focus,
select:focus-visible {
  outline: none;
}

/* ============================================================================ */
/* CONTAINER LAYOUT                                                             */
/* ============================================================================ */

.container {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 420px 1fr;
  grid-gap: 20px;
  gap: 20px;
  height: calc(100vh - 40px);
  transition: grid-template-columns 0.3s ease;
  overflow: hidden;
}

/* Для десктопа > 1100px разрешаем overflow для кнопки fullscreen */
@media (min-width: 1101px) {
  .container {
    overflow: visible;
  }
}

.container.fullscreen-chat {
  grid-template-columns: 1fr 0;
  gap: 0;
  height: calc(100vh - 40px);
}

/* ============================================================================ */
/* SIDEBAR                                                                       */
/* ============================================================================ */

.sidebar {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s ease;
  height: 100%;
  min-height: 0;
  overflow: visible;
}

.sidebar .header {
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.sidebar .upload-zone {
  overflow: hidden;
}

.sidebar .chat-section {
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.sidebar.documents-panel-collapsed .chat-section {
  border-radius: var(--radius);
}

.sidebar.documents-panel-animating .chat-section {
  border-radius: var(--radius);
}

.documents-panel-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 1;
  flex-shrink: 0;
  width: 100%;
  max-height: 900px;
  overflow: visible;
  background: transparent;
  transform: translateY(0);
  transition: none;
  will-change: auto;
}

.documents-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.documents-panel.collapsed {
  pointer-events: none;
}

.sidebar.documents-panel-collapsed .documents-panel-wrapper {
  max-height: 0;
  margin: 0;
  pointer-events: none;
  transform: translateY(-18px);
}

.sidebar.documents-panel-collapsed .documents-panel-wrapper,
.sidebar.documents-panel-animating .documents-panel-wrapper {
  overflow: hidden;
}

.sidebar.documents-panel-animating .documents-panel-wrapper {
  transition: max-height 0.3s ease, transform 0.3s ease;
  will-change: max-height, transform;
}


@media (min-width: 1101px) {
  .sidebar.fullscreen.documents-panel-collapsed {
    row-gap: 0;
    padding-top: 0;
  }
}

/* Fullscreen стили только для десктопа (> 1100px) */
@media (min-width: 1101px) {
  .sidebar.fullscreen {
    border-radius: var(--radius);
    max-width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: auto auto auto 1fr;
    grid-template-rows: auto 1fr;
    grid-column-gap: 20px;
    column-gap: 20px;
    grid-row-gap: 10px;
    row-gap: 10px;
    padding: 16px 20px 0 20px;
    align-items: start;
    overflow: visible;
    background: white;
    position: relative;
  }

  .sidebar.fullscreen .documents-panel-wrapper {
    grid-column: 2 / 4;
    grid-row: 1;
    display: grid;
    grid-template-columns: auto auto;
    grid-column-gap: 20px;
    column-gap: 20px;
    align-items: center;
    width: 100%;
  }

  .sidebar.fullscreen .documents-panel {
    display: contents;
  }
}

/* Все дочерние стили .sidebar.fullscreen только для десктопа */
@media (min-width: 1101px) {
  .sidebar.fullscreen .header {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 0;
    box-shadow: none;
    align-self: center;
    overflow: visible;
  }

  .sidebar.fullscreen .header-logo {
    width: 72px;
    height: 65px;
    filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.2))
            drop-shadow(0 0 20px rgba(167, 139, 250, 0.15))
            drop-shadow(0 2px 8px rgba(103, 101, 198, 0.2));
  }

  .sidebar.fullscreen .header-content {
    min-width: 236px;
    max-width: 250px;
  }

  .sidebar.fullscreen .upload-zone {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    padding: 12px 18px;
    border-radius: 12px;
    min-height: auto;
    min-width: 320px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    align-self: center;
  }

  .sidebar.fullscreen .upload-zone .upload-text {
    font-size: 19px;
  }

  .sidebar.fullscreen .upload-zone .upload-hint {
    font-size: 12px;
  }

  .sidebar.fullscreen .upload-icon {
    gap: 5px;
  }

  .sidebar.fullscreen .upload-icon img {
    width: 40px;
    height: 40px;
  }

  .sidebar.fullscreen .documents-section {
    grid-column: 2;
    grid-row: 1;
    padding: 0;
    border-bottom: none;
    max-height: none;
    min-width: 320px;
    max-width: 320px;
    width: 320px;
    align-self: center;
    overflow: visible;
    z-index: 100;
  }

  .sidebar.fullscreen .custom-dropdown {
    min-width: 320px;
    max-width: 320px;
    width: 100%;
  }

  .sidebar.fullscreen .chat-section {
    grid-column: 1 / -1;
    grid-row: 2;
    border-radius: 0 0 var(--radius) var(--radius);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 16px;
    min-height: 0;
    height: 100%;
  }

  .sidebar.fullscreen .chat-messages {
    flex: 1 1;
    overflow-y: auto;
    padding: 16px 20px;
    padding-bottom: calc(16px + var(--chat-input-overlap));
    background: white;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
  }

  .sidebar.fullscreen .chat-input-container {
    flex-shrink: 0;
  }

  .sidebar.fullscreen .pinned-fragments-area {
    flex-shrink: 0;
  }

  /* Скрыть zoom-control в fullscreen режиме */
  .container.fullscreen-chat .zoom-control {
    display: none !important;
  }
}

/* ============================================================================ */
/* FULLSCREEN TOGGLE BUTTON                                                     */
/* ============================================================================ */

.fullscreen-toggle {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 178px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 9999;
  border-radius: 2px;
  border: none;
  background: transparent;
  -webkit-clip-path: none;
          clip-path: none;
  overflow: visible;
}

/* Показываем кнопку только на десктопе > 1100px */
@media (min-width: 1101px) {
  .sidebar {
    overflow: visible !important;
  }

  .fullscreen-toggle {
    display: flex !important;
  }
}

.fullscreen-toggle:hover {
  width: 18px;
}

.fullscreen-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  -webkit-clip-path: polygon(0 0%, 100% 30%, 100% 70%, 0 100%);
          clip-path: polygon(0 0%, 100% 30%, 100% 70%, 0 100%);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  transition: all 0.3s ease;
  pointer-events: none;
}

.fullscreen-toggle:hover::before {
  box-shadow: 3px 0 10px rgba(0, 0, 0, 0.15);
}

.fullscreen-toggle i {
  color: #333;
  font-size: 10px;
  transition: transform 0.3s ease;
  margin-left: 1px;
}

.fullscreen-toggle-icon {
  width: 12px;
  height: 12px;
  margin-right: 5px;
  opacity: 0.85;
}

.fullscreen-toggle-icon.left {
  transform: rotate(180deg);
}

.fullscreen-toggle-icon.right {
  transform: rotate(0deg);
}

.container.fullscreen-chat .sidebar .fullscreen-toggle {
  right: -10px;
}

/* ============================================================================ */
/* DOCUMENTS PANEL TOGGLE BUTTON                                                */
/* ============================================================================ */

.documents-panel-toggle {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 178px;
  height: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10001;
  border-radius: 2px;
  border: none;
  background: transparent;
  -webkit-clip-path: none;
          clip-path: none;
  overflow: visible;
}

.documents-panel-toggle:hover {
  height: 18px;
}

.documents-panel-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  -webkit-clip-path: polygon(15% 0, 85% 0, 100% 100%, 0 100%);
          clip-path: polygon(15% 0, 85% 0, 100% 100%, 0 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  transition: all 0.3s ease;
  pointer-events: none;
}

.documents-panel-toggle:hover::before {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.documents-panel-toggle i {
  color: #333;
  font-size: 10px;
}

.documents-panel-toggle-icon {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  opacity: 0.85;
}

.documents-panel-toggle-icon.up {
  transform: rotate(-90deg);
}

.documents-panel-toggle-icon.down {
  transform: rotate(90deg);
}

.fullscreen-toggle::after,
.documents-panel-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 6px);
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.fullscreen-toggle::after {
  top: 50%;
  transform: translate(-50%, -50%);
  margin-top: 10px;
}

.fullscreen-toggle:hover::after {
  opacity: 1;
}

.documents-panel-toggle:hover::after {
  opacity: 1;
  transform: translate(-50%, 4px);
}

@media (hover: none) and (pointer: coarse) {
  .fullscreen-toggle::after,
  .documents-panel-toggle::after {
    display: none;
  }

  .documents-panel-toggle,
  .documents-panel-toggle::before,
  .documents-panel-toggle::after {
    transition: none !important;
  }

  .documents-panel-toggle:hover {
    height: 10px !important;
  }

  .documents-panel-toggle:hover::before {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  }
}

.documents-panel-toggle--header {
  display: none;
}

@media (max-width: 1100px) {
  .documents-panel-toggle--sidebar {
    display: none !important;
  }

  .documents-panel-toggle--header {
    position: absolute;
    top: 47px;
    left: 66px;
    transform: none;
    display: inline-flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
  }
}

/* ============================================================================ */
/* MAIN CONTENT                                                                  */
/* ============================================================================ */

.main-content {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  min-width: 0;
  max-width: 100%;
}

.container.fullscreen-chat .main-content {
  opacity: 0;
  visibility: hidden;
  width: 0;
  overflow: hidden;
}

/* ============================================================================ */
/* HEADER                                                                        */
/* ============================================================================ */

.header {
  background: white;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.header-logo {
  width: 72px;
  height: 65px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.25))
          drop-shadow(0 0 40px rgba(167, 139, 250, 0.15))
          drop-shadow(0 4px 12px rgba(103, 101, 198, 0.2));
}

.header-content {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: #4461ed;
}

.domain-flipper {
  display: inline-block;
  position: relative;
  min-width: 120px;
  height: 17px;
  vertical-align: baseline;
  line-height: 17px;
}

.domain-flipper span {
  position: absolute;
  left: 0;
  right: 0;
  text-align: left;
  animation: domainFlip 4s ease-in-out infinite;
  opacity: 0;
  transform: rotateX(90deg);
  white-space: nowrap;
}

.domain-flipper span:nth-child(1) {
  animation-delay: 0s;
}

.domain-flipper span:nth-child(2) {
  animation-delay: 2s;
}

@keyframes domainFlip {
  0%, 45% {
    opacity: 1;
    transform: rotateX(0deg);
  }
  50%, 95% {
    opacity: 0;
    transform: rotateX(-90deg);
  }
  100% {
    opacity: 0;
    transform: rotateX(-90deg);
  }
}

.header p {
  font-size: 10px;
  line-height: 1.3;
  max-width: 100%;
  color: #6f65c6;
  font-weight: bold;
  margin: 0;
}

/* ============================================================================ */
/* UPLOAD ZONE                                                                   */
/* ============================================================================ */

.upload-zone {
  margin: 12px 12px 5px 12px;
  padding: 14px 18px;
  border: 2px dashed rgba(102, 126, 234, 0.55);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(102, 126, 234, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(102, 126, 234, 0.14);
}

.upload-icon {
  display: flex;
  align-items: center;
  gap: 4px;
}

.upload-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.upload-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.upload-text {
  font-size: 19px;
  color: #1f2937;
  font-weight: 700;
}

.upload-hint {
  font-size: 12px;
  color: #6b7280;
}

.upload-zone.uploading {
  pointer-events: none;
}

/* Спиннер для UploadZone */
.upload-spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(67, 97, 238, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================================================ */
/* DOCUMENTS DROPDOWN                                                            */
/* ============================================================================ */

.documents-section {
  padding: 5px 12px 12px;
  display: flex;
  flex-direction: column;
  max-height: 350px;
  overflow: visible;
  position: relative;
  z-index: 100;
}

.custom-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-header {
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.3s;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.dropdown-header:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.1);
}

.dropdown-header.active {
  border-color: var(--primary);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.dropdown-selected {
  flex: 1 1;
  min-width: 0;
  overflow: hidden;
  max-width: 100%;
  display: flex;
  align-items: center;
}

.dropdown-selected-name {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  min-width: 0;
}

.dropdown-selected-name i,
.dropdown-selected-name svg {
  color: #999;
  margin-right: 8px;
  flex-shrink: 0;
}

.dropdown-selected-placeholder {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #999;
  min-width: 0;
}

.dropdown-selected-placeholder i,
.dropdown-selected-placeholder svg {
  color: #999;
  margin-right: 8px;
  flex-shrink: 0;
}

.dropdown-arrow {
  font-size: 12px;
  color: var(--primary);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.dropdown-header.active .dropdown-arrow {
  transform: rotate(180deg);
}

.documents-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 0;
  overflow: hidden;
  border: 2px solid var(--primary);
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.documents-list.show {
  max-height: 300px;
  overflow-y: auto;
  opacity: 1;
}

.documents-list::-webkit-scrollbar {
  width: 6px;
}

.documents-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  gap: 8px;
}

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

.document-item:hover {
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.05), rgba(63, 55, 201, 0.05));
}

.document-item.active {
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.15), rgba(63, 55, 201, 0.1));
  border-left: 3px solid var(--primary);
}

.document-info {
  flex: 1 1;
  min-width: 0;
}

.document-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-name i,
.document-name svg {
  color: #999;
  margin-right: 8px;
  flex-shrink: 0;
}

.document-id {
  font-size: 10px;
  color: #999;
  margin-top: 2px;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.document-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.delete-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-btn:hover {
  transform: scale(1.2);
}

.delete-btn:active {
  transform: scale(1.0);
}

.empty-documents {
  text-align: center;
  padding: 30px 20px;
  color: #999;
  font-size: 12px;
}

.empty-state {
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 12px;
}

/* ============================================================================ */
/* DOCUMENTS CONTROLS (MOBILE)                                                   */
/* ============================================================================ */

.documents-controls {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.documents-controls .custom-dropdown {
  flex: 1 1;
}

.view-document-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 18px;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  line-height: 1;
  text-align: center;
  align-items: center;
  justify-content: center;
  display: none;
}

.view-document-btn svg {
  display: block;
}

@media (max-width: 1100px) {
  .view-document-btn {
    display: inline-flex !important;
  }
}

.view-document-btn:hover {
  background: #3d52c9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.view-document-btn:active {
  transform: translateY(0);
}

.view-document-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.back-to-sidebar-btn {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 18px;
  flex-shrink: 0;
  margin-right: 12px;
}

.back-to-sidebar-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateX(-2px);
}

.back-to-sidebar-btn:active {
  transform: translateX(0);
}

/* ============================================================================ */
/* CHAT SECTION                                                                  */
/* ============================================================================ */

.chat-section {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  position: relative;
  --chat-input-overlap: 32px;
}

.chat-section.input-expanded {
  --chat-input-overlap: 0px;
}

.chat-input-spacer {
  flex-shrink: 0;
}

.chat-header {
  display: none;
}

.chat-messages {
  flex: 1 1;
  padding: 16px 20px;
  padding-bottom: calc(16px + var(--chat-input-overlap));
  overflow-y: auto;
  background: white;
  min-width: 0;
  max-width: 100%;
}

.sidebar.documents-panel-collapsed .chat-messages {
  margin-top: 10px;
}

.chat-messages.no-animations .message {
  animation: none;
}

.chat-messages.is-restoring {
  opacity: 0;
  pointer-events: none;
}

.message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 85%;
  animation: slideIn 0.3s ease;
  font-size: 15px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message.assistant {
  overflow-x: visible;
}

.message.assistant .table-wrapper {
  word-break: normal;
  overflow-wrap: normal;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.message.user {
  background: var(--primary);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.message.assistant {
  background: #e9f4ff;
  color: var(--dark);
  border-bottom-left-radius: 4px;
}

.message-content {
  width: 100%;
}

.message-content > :first-child {
  margin-top: 0;
}

.message-content > :last-child {
  margin-bottom: 0;
}

.message.assistant .message-content p {
  margin: 0 0 8px;
}

.message.assistant .message-content p:last-child {
  margin-bottom: 0;
}

.message.assistant .message-content h1:first-of-type,
.message.assistant .message-content h2:first-of-type,
.message.assistant .message-content h3:first-of-type,
.message.assistant .message-content ul:first-of-type,
.message.assistant .message-content ol:first-of-type,
.message.assistant .message-content pre:first-of-type,
.message.assistant .message-content table:first-of-type,
.message.assistant .message-content blockquote:first-of-type {
  margin-top: 0;
}

.message-actions {
  display: flex;
  gap: 0;
  justify-content: flex-end;
  align-items: center;
  margin-top: 2px;
}

.message-action-btn {
  border: none;
  background: transparent;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.message-action-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.message-action-btn:hover {
  opacity: 1;
  background: rgba(102, 126, 234, 0.12);
}

.message-action-btn:active {
  opacity: 1;
}

.message.user .message-action-btn {
  color: rgba(255, 255, 255, 0.9);
}

.message.user .message-action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.message.assistant .message-action-btn {
  color: #4b5563;
}

.message.assistant .message-actions {
  justify-content: flex-start;
}

.message-action-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 6px);
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.message-action-btn:hover .message-action-tooltip {
  opacity: 1;
  transform: translate(-50%, 4px);
}

.message-action-btn.is-copied svg {
  transform: scale(1.08);
}

@media (hover: none) and (pointer: coarse) {
  .message-action-tooltip {
    display: none;
  }

  .message-action-btn.is-copied .message-action-tooltip {
    display: block;
    opacity: 1;
    transform: translate(-50%, 4px);
  }

  .reply-preview {
    transition-duration: 0.18s;
  }
}

.reply-preview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #f3f4f6;
  border-radius: 14px;
  padding: 0 12px;
  border-left: 0 solid #a855f7;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  overflow: hidden;
  margin-bottom: 0;
  pointer-events: none;
  transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.25s ease,
    padding 0.25s ease, margin 0.25s ease, border-color 0.25s ease;
}

.reply-preview.is-active {
  padding: 8px 12px;
  border-left-width: 3px;
  max-height: 140px;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 8px;
  pointer-events: auto;
}

.reply-preview-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.reply-preview-label {
  font-size: 11px;
  font-weight: 600;
  color: #8b5cf6;
}

.reply-preview-content {
  font-size: 13px;
  color: #4b5563;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.reply-preview-content br {
  display: none;
}

.reply-preview-close {
  border: none;
  background: transparent;
  color: #9ca3af;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.reply-preview-close:hover {
  color: #6b7280;
}

/* Фрагменты в сообщениях пользователя */
.message-fragment {
  background: linear-gradient(135deg, rgba(254, 240, 138, 0.3), rgba(253, 224, 71, 0.2));
  border: 1.5px solid rgba(250, 204, 21, 0.5);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

.message-fragment .fragment-label {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.message-fragment .fragment-text {
  color: rgba(255, 255, 255, 0.85);
  font-style: italic;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.message-text {
  margin-top: 4px;
}

/* Markdown стили для сообщений от AI */
.message.assistant h1,
.message.assistant h2,
.message.assistant h3 {
  margin: 16px 0 8px 0;
  font-weight: 700;
  line-height: 1.3;
}

.message.assistant h1 {
  font-size: 18px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 6px;
}

.message.assistant h2 {
  font-size: 16px;
  color: var(--primary);
}

.message.assistant h3 {
  font-size: 14px;
  color: var(--secondary);
}

.message.assistant p {
  margin: 8px 0;
}

.message.assistant strong {
  font-weight: 700;
  color: var(--dark);
}

.message.assistant em {
  font-style: italic;
  color: #555;
}

.message.assistant ul,
.message.assistant ol {
  margin: 8px 0;
  padding-left: 24px;
}

.message.assistant li {
  margin: 4px 0;
}

.message.assistant code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.message.assistant pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.message.assistant pre code {
  background: none;
  padding: 0;
}

/* Wrapper для таблиц с горизонтальным скроллом */
.table-wrapper {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin: 12px 0;
}

.message.assistant,
.message.assistant .message-content,
.message.assistant .table-wrapper,
.message.assistant table,
.message.assistant table th,
.message.assistant table td {
  text-size-adjust: 100%;
}

.message.assistant table {
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.4;
  width: max-content;
  min-width: 100%;
  margin: 0;
}

.message.assistant table *,
.message.assistant .assistant-table * {
  font-size: inherit !important;
  line-height: inherit !important;
}

.message.assistant table th,
.message.assistant table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
  line-height: 1.4;
}

.message.assistant table th {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

.message.assistant table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

@supports (-webkit-touch-callout: none) {
  .message.assistant table,
  .message.assistant table * {
    text-size-adjust: none !important;
  }

  .message.assistant table {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  .message.assistant table * {
    font-size: inherit !important;
    line-height: inherit !important;
  }

  .message.assistant table th,
  .message.assistant table td {
    font-size: 12px !important;
    line-height: 1.4 !important;
    padding: 8px 12px !important;
  }
}

.message.assistant blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 12px;
  margin: 12px 0;
  color: #555;
  font-style: italic;
}

.message.assistant hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 16px 0;
}

.message.assistant a {
  color: var(--primary);
  text-decoration: underline;
}

.message.assistant a:hover {
  color: var(--secondary);
}

/* ============================================================================ */
/* CHAT INPUT                                                                    */
/* ============================================================================ */

.chat-input-container {
  position: relative;
  margin: calc(-1 * var(--chat-input-overlap)) 16px 16px;
  padding: 8px 16px 14px;
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 22px;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2;
}

.pinned-fragments-area + .chat-input-container {
  margin-top: 0;
}

.chat-input-container.is-expanded {
  position: absolute;
  top: 12px;
  right: 16px;
  bottom: 16px;
  left: 16px;
  margin: 0;
  border-radius: 22px;
  background: white;
  border: 1.5px solid #e5e7eb;
  box-shadow: 0 18px 30px rgba(17, 24, 39, 0.14);
  z-index: 20;
}

.chat-input-consent {
  margin: -8px 16px 14px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.45;
}

.chat-input-consent button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #4b5563;
  text-decoration: underline;
  cursor: pointer;
}

.chat-input-consent button:hover {
  color: var(--primary);
}

@media (max-width: 767px) {
  .chat-input-consent {
    margin: -8px 16px -4px;
    font-size: 13px;
  }
}

.chat-input-wrapper {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  transition: none;
}

.chat-input-wrapper:focus-within {
  border-color: transparent;
  box-shadow: none;
}

.chat-input {
  flex: 1 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  max-height: 110px;
  min-height: 24px;
  line-height: 22px;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
  color: #111827;
  background: transparent;
}

.chat-input::-webkit-scrollbar {
  width: 4px;
}

.chat-input::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.chat-input::placeholder {
  color: #9ca3af;
}

.chat-input:disabled {
  background: transparent;
  color: #9ca3af;
  opacity: 1;
  -webkit-text-fill-color: #9ca3af;
}

.chat-input-container.is-expanded .chat-input-wrapper {
  flex: 1 1;
  min-height: 0;
}

.chat-input-container.is-expanded .chat-input {
  height: 100%;
  max-height: none;
}

.chat-expand-toggle {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1.5px solid #e5e7eb;
  background: white;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  padding: 0;
  z-index: 2;
}

.chat-expand-toggle:hover {
  background: #f3f4f6;
  color: #4361ee;
  border-color: #c7d2fe;
}

.chat-expand-toggle svg {
  width: 16px;
  height: 16px;
}

.chat-input-container.is-expanded .chat-toolbar {
  margin-top: auto;
}
.send-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: #a1aff9;
  color: white;
  border: none;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.send-btn:hover:not(:disabled) {
  background: #3653e0;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(67, 97, 238, 0.25);
}

.send-btn:disabled {
  background: #a1aff9;
  cursor: not-allowed;
  opacity: 1;
}

.send-btn:not(:disabled) {
  background: #4361ee;
}

.send-btn-icon {
  width: 18px;
  height: 18px;
}

.send-btn-icon.spin {
  animation: spin 0.8s linear infinite;
}

.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-mode-selector {
  position: relative;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: #eef0ff;
  color: #4b6bff;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.chat-mode-selector > * {
  pointer-events: none;
}

.chat-mode-selector img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
}

.chat-mode-label {
  pointer-events: none;
}

.chat-mode-dropdown {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: transparent;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  opacity: 0.01;
  z-index: 1;
  pointer-events: auto;
}

.chat-mode-dropdown option {
  background: white;
  color: var(--dark);
}

.chat-mode-dropdown option:disabled {
  color: #999;
  background: #f5f5f5;
}

/* ============================================================================ */
/* LOADING MESSAGE                                                               */
/* ============================================================================ */

.message.loading {
  background: white !important;
  padding: 16px !important;
  border-radius: 12px !important;
  max-width: 100% !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.loading-header {
  text-align: center;
  width: 100%;
}

.loading-title {
  font-size: 15px;
  font-weight: 600;
  color: #7c3aed;
  margin-bottom: 4px;
}

.loading-subtitle {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
  margin-bottom: 2px;
}

.loading-timer {
  font-size: 13px;
  font-weight: 600;
  color: #7c3aed;
  font-family: 'Courier New', monospace;
  background: rgba(124, 58, 237, 0.08);
  padding: 4px 12px;
  border-radius: 12px;
  margin-top: 2px;
  display: inline-block;
}

.loading-video-wrapper {
  width: 100%;
  max-width: 400px;
  position: relative;
}

.loading-video-wrapper::before,
.loading-video-wrapper::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  background: white;
  z-index: 100;
  pointer-events: none;
}

.loading-video-wrapper::before {
  top: 0;
  height: 8px;
}

.loading-video-wrapper::after {
  bottom: 0;
  height: 12px;
}

.message.loading video {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
}

/* ============================================================================ */
/* CONTENT HEADER & VIEWER                                                       */
/* ============================================================================ */

.content-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

.content-header-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: auto;
}

.content-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
}

.download-btn {
  background: var(--success);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.download-btn:hover:not(:disabled) {
  background: #05c594;
  transform: scale(1.05);
}

.download-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.download-btn.loading {
  position: relative;
  pointer-events: none;
}

/* Спиннер для кнопок */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

.document-viewer {
  flex: 1 1;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 0;
  position: relative;
}

.pdf-container {
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
}

.pdf-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  transform-origin: top center;
  transition: transform 0.2s ease;
}

/* ============================================================================ */
/* ZOOM CONTROL                                                                  */
/* ============================================================================ */

.zoom-control {
  position: absolute;
  bottom: 30px;
  right: 30px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 8px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

@media (min-width: 1101px) {
  .zoom-control {
    display: flex;
  }
}

.zoom-control:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.zoom-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
  transition: all 0.2s;
}

.zoom-btn:hover {
  background: rgba(67, 97, 238, 0.1);
  transform: scale(1.1);
}

.zoom-btn:active {
  transform: scale(0.95);
}

.zoom-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.zoom-level {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  min-width: 50px;
  text-align: center;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

/* ============================================================================ */
/* SCROLLBAR                                                                     */
/* ============================================================================ */

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

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

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ============================================================================ */
/* TOAST NOTIFICATION                                                            */
/* ============================================================================ */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
  animation: slideInRight 0.3s ease;
  z-index: 10000;
  min-width: 300px;
}

.toast.show {
  display: block;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.toast-text {
  font-size: 14px;
  color: #111827;
}

.toast-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(67, 97, 238, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  border-left: 4px solid var(--success);
}

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

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.error .toast-icon {
  color: var(--danger);
}

.toast.info {
  border-left: 4px solid var(--primary);
}

.toast.info .toast-icon {
  color: var(--primary);
}

/* ============================================================================ */
/* CONFIRM MODAL                                                                 */
/* ============================================================================ */

.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
  height: var(--app-height);
  max-height: var(--app-height);
  padding: calc(var(--modal-side-padding) + env(safe-area-inset-top))
    calc(var(--modal-side-padding) + env(safe-area-inset-right))
    calc(var(--modal-side-padding) + env(safe-area-inset-bottom))
    calc(var(--modal-side-padding) + env(safe-area-inset-left));
}

.confirm-modal.show {
  display: flex;
}

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

.confirm-dialog {
  background: white;
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

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

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
}

.confirm-message {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.confirm-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-btn.yes {
  background: var(--danger);
  color: white;
}

.confirm-btn.yes:hover {
  background: #d63555;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 71, 111, 0.3);
}

.confirm-btn.no {
  background: var(--light);
  color: var(--dark);
}

.confirm-btn.no:hover {
  background: #e9ecef;
}

/* ============================================================================ */
/* SELECTION POPUP                                                               */
/* ============================================================================ */

.selection-popup {
  position: fixed;
  display: none;
  z-index: 99999;
  background: #fef08a;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  animation: popupAppear 0.2s ease;
  white-space: nowrap;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

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

.selection-popup:hover {
  background: #fde047;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateX(-50%) translateY(-2px);
}

.selection-popup:active {
  transform: translateX(-50%) translateY(0);
}

/* ============================================================================ */
/* PINNED FRAGMENTS AREA                                                         */
/* ============================================================================ */

.pinned-fragments-area {
  max-height: 150px;
  overflow-y: auto;
  padding: 8px 16px 0;
  background: #fafafa;
  border-top: 1px solid var(--border);
}

.pinned-fragments-area:empty {
  display: none;
}

.chat-pinned-note {
  background: linear-gradient(135deg, rgba(254, 240, 138, 0.4), rgba(253, 224, 71, 0.25));
  border: 2px solid #facc15;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  animation: slideIn 0.3s ease;
  box-shadow: 0 2px 6px rgba(250, 204, 21, 0.15);
}

.chat-pinned-note .note-content {
  flex: 1 1;
  color: #4b5563;
  line-height: 1.3;
}

.chat-pinned-note .note-label {
  font-weight: 700;
  color: #92400e;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.chat-pinned-note .note-text {
  color: #1f2937;
  font-style: italic;
  font-size: 11px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chat-pinned-note .remove-note {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-pinned-note .remove-note:hover {
  color: #ef4444;
  transform: scale(1.1);
}

.chat-pinned-note .remove-note:active {
  transform: scale(0.9);
}

/* ============================================================================ */
/* FOOTER                                                                        */
/* ============================================================================ */

.footer {
  background: transparent;
  border-top: none;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.footer-links a:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.22);
  text-decoration: none;
}

.footer-links a svg {
  flex-shrink: 0;
}

.footer-server {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #313131;
  font-weight: 600;
  background: rgb(255 255 255 / 52%);
  padding: 6px 12px;
  border-radius: 20px;
}

.footer-server img {
  width: 20px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Мобильная версия футера (≤1100px) */
@media (max-width: 1100px) {
  .footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-top: 1px solid rgba(103, 101, 198, 0.1);
    flex-direction: column;
    text-align: center;
    padding: 12px 16px 30px;
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }

  .footer-links a {
    color: #4c5bd4;
    background: #ffffff;
    border-color: rgba(103, 101, 198, 0.2);
    box-shadow: 0 2px 8px rgba(103, 101, 198, 0.08);
  }

  .footer-links a:hover {
    color: #3647c2;
    background: #f6f7ff;
  }

  .footer-server {
    color: #555;
    background: rgba(103, 101, 198, 0.05);
  }
}

@media (max-width: 960px) {
  .footer {
    display: none;
  }
}

/* ============================================================================ */
/* RESPONSIVE - TABLET ≤1100px                                                   */
/* ============================================================================ */

@media (max-width: 1100px) {
  body {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
  }

  .container {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100vh !important;
  }

  @supports (-webkit-touch-callout: none) {
    body {
      min-height: -webkit-fill-available !important;
    }
    .container {
      min-height: -webkit-fill-available !important;
    }
  }

  .container.fullscreen-chat {
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    border-radius: 0;
    max-width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  @supports (-webkit-touch-callout: none) {
    .sidebar {
      height: 100% !important;
      min-height: 0 !important;
    }
  }

  .container:not(.mobile-document-view) .main-content {
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .fullscreen-toggle {
    display: none !important;
  }

  .container:not(.mobile-document-view) .zoom-control {
    display: none !important;
  }

  .back-to-sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar:not(.fullscreen),
  .sidebar.fullscreen {
    display: grid;
    grid-template-columns: auto auto 1fr;
    grid-template-rows: auto 1fr;
    grid-column-gap: 15px;
    column-gap: 15px;
    grid-row-gap: 10px;
    row-gap: 10px;
    padding: 12px 16px 0 16px;
    align-items: start;
    overflow: visible;
    background: white;
    position: relative;
  }

  .sidebar:not(.fullscreen) .documents-panel-wrapper,
  .sidebar.fullscreen .documents-panel-wrapper {
    grid-column: 2 / -1;
    grid-row: 1;
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .sidebar:not(.fullscreen) .documents-panel,
  .sidebar.fullscreen .documents-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-column-gap: 15px;
    column-gap: 15px;
    align-items: center;
    width: 100%;
  }

  .sidebar.documents-panel-collapsed {
    row-gap: 0;
    padding-top: 0;
  }

  .sidebar .upload-zone,
  .sidebar .documents-section,
  .sidebar.fullscreen .upload-zone,
  .sidebar.fullscreen .documents-section {
    max-height: 400px;
  }

  .sidebar:not(.fullscreen) .header,
  .sidebar.fullscreen .header {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 0;
    box-shadow: none;
    align-self: center;
    overflow: visible;
  }

  .sidebar:not(.fullscreen) .header-logo,
  .sidebar.fullscreen .header-logo {
    width: 65px;
    height: auto;
    filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.2))
            drop-shadow(0 0 16px rgba(167, 139, 250, 0.15))
            drop-shadow(0 2px 6px rgba(103, 101, 198, 0.2));
  }

  .sidebar:not(.fullscreen) .header-content,
  .sidebar.fullscreen .header-content {
    min-width: auto;
    max-width: 200px;
  }

  .sidebar:not(.fullscreen) .header-content h1,
  .sidebar.fullscreen .header-content h1 {
    font-size: 13px;
  }

  .sidebar:not(.fullscreen) .header-content p,
  .sidebar.fullscreen .header-content p {
    font-size: 8px;
  }

  .sidebar:not(.fullscreen) .upload-zone,
  .sidebar.fullscreen .upload-zone {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    padding: 10px 16px;
    border-radius: 12px;
    min-height: auto;
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    align-self: center;
  }

  .sidebar:not(.fullscreen) .upload-zone .upload-text,
  .sidebar.fullscreen .upload-zone .upload-text {
    font-size: 19px;
  }

  .sidebar:not(.fullscreen) .upload-zone .upload-hint,
  .sidebar.fullscreen .upload-zone .upload-hint {
    font-size: 12px;
  }

  .sidebar:not(.fullscreen) .upload-icon,
  .sidebar.fullscreen .upload-icon {
    gap: 0;
    display: flex;
  }

  .sidebar:not(.fullscreen) .upload-icon img,
  .sidebar.fullscreen .upload-icon img {
    width: 38px;
    height: 38px;
  }

  .sidebar:not(.fullscreen) .documents-section,
  .sidebar.fullscreen .documents-section {
    grid-column: 2;
    grid-row: 1;
    padding: 0;
    border-bottom: none;
    max-height: none;
    align-self: center;
    overflow: visible;
    z-index: 100;
    width: 100%;
  }

  .sidebar:not(.fullscreen) .documents-controls,
  .sidebar.fullscreen .documents-controls {
    display: flex;
    width: 100%;
    gap: 8px;
    align-items: center;
  }

  .sidebar:not(.fullscreen) .custom-dropdown,
  .sidebar.fullscreen .custom-dropdown {
    flex: 1 1;
    min-width: 150px;
  }

  .sidebar:not(.fullscreen) .view-document-btn,
  .sidebar.fullscreen .view-document-btn {
    flex-shrink: 0;
  }

  .sidebar:not(.fullscreen) .chat-section,
  .sidebar.fullscreen .chat-section {
    grid-column: 1 / -1;
    grid-row: 2;
    border-radius: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 16px;
    min-height: 0;
    height: 100%;
  }

  .sidebar:not(.fullscreen) .chat-messages,
  .sidebar.fullscreen .chat-messages {
    flex: 1 1;
    overflow-y: auto;
    padding: 16px 20px;
    padding-bottom: calc(16px + var(--chat-input-overlap));
    background: white;
    min-width: 0;
    max-width: 100%;
  }

  .sidebar:not(.fullscreen) .chat-input-container,
  .sidebar.fullscreen .chat-input-container {
    flex-shrink: 0;
  }

  .sidebar:not(.fullscreen) .pinned-fragments-area,
  .sidebar.fullscreen .pinned-fragments-area {
    flex-shrink: 0;
  }
}

/* ============================================================================ */
/* RESPONSIVE - MOBILE <960px                                                    */
/* ============================================================================ */

@media (max-width: 959px) {
  .sidebar,
  .sidebar.fullscreen {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    gap: 0 !important;
    grid-template-columns: unset !important;
    grid-template-rows: unset !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .sidebar .header,
  .sidebar.fullscreen .header {
    display: flex !important;
    flex-direction: row !important;
    padding: 12px 16px !important;
    gap: 12px !important;
    grid-column: unset !important;
    grid-row: unset !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
  }

  .sidebar .header-logo,
  .sidebar.fullscreen .header-logo {
    width: 55px !important;
    height: auto !important;
    flex-shrink: 0 !important;
  }

  .sidebar .documents-panel-wrapper,
  .sidebar.fullscreen .documents-panel-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    grid-column: unset !important;
    grid-row: unset !important;
    column-gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .sidebar .documents-panel,
  .sidebar.fullscreen .documents-panel {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
  }

  .sidebar .header-content,
  .sidebar.fullscreen .header-content {
    min-width: auto !important;
    max-width: none !important;
    flex: 1 1 !important;
  }

  .sidebar .header-content h1,
  .sidebar.fullscreen .header-content h1 {
    font-size: 15px !important;
  }

  .sidebar .header-content p,
  .sidebar.fullscreen .header-content p {
    font-size: 10px !important;
  }

  .sidebar .upload-zone,
  .sidebar.fullscreen .upload-zone {
    margin: 0 !important;
    margin-top: 12px !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    grid-column: unset !important;
    grid-row: unset !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: calc(100% - 32px) !important;
    margin-left: 16px !important;
    margin-right: 16px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
  }

  .sidebar .upload-zone .upload-icon,
  .sidebar.fullscreen .upload-zone .upload-icon {
    display: flex !important;
    gap: 0 !important;
  }

  .sidebar .upload-zone .upload-icon img,
  .sidebar.fullscreen .upload-zone .upload-icon img {
    width: 36px !important;
    height: 36px !important;
  }

  .sidebar .upload-zone .upload-text,
  .sidebar.fullscreen .upload-zone .upload-text {
    font-size: 18px !important;
  }

  .sidebar .upload-zone .upload-hint,
  .sidebar.fullscreen .upload-zone .upload-hint {
    font-size: 11px !important;
  }

  .sidebar .documents-section,
  .sidebar.fullscreen .documents-section {
    padding: 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
    min-width: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    grid-column: unset !important;
    grid-row: unset !important;
    overflow: visible !important;
    z-index: 1000 !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }

  .sidebar .documents-controls,
  .sidebar.fullscreen .documents-controls {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .sidebar .custom-dropdown,
  .sidebar.fullscreen .custom-dropdown {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .sidebar .dropdown-header,
  .sidebar.fullscreen .dropdown-header {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .sidebar .dropdown-selected,
  .sidebar.fullscreen .dropdown-selected {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .sidebar .chat-section,
  .sidebar.fullscreen .chat-section {
    flex: 1 1 !important;
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    grid-column: unset !important;
    grid-row: unset !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .sidebar .chat-messages,
  .sidebar.fullscreen .chat-messages {
    flex: 1 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .sidebar .chat-input-container,
  .sidebar.fullscreen .chat-input-container {
    flex-shrink: 0 !important;
  }

  .sidebar .pinned-fragments-area,
  .sidebar.fullscreen .pinned-fragments-area {
    flex-shrink: 0 !important;
  }

  .message {
    max-width: 95% !important;
    min-width: 0 !important;
    font-size: 16px !important;
  }
}

/* ============================================================================ */
/* RESPONSIVE - SMALL <480px                                                     */
/* ============================================================================ */

@media (max-width: 479px) {
  .sidebar,
  .sidebar.fullscreen {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .sidebar .header,
  .sidebar.fullscreen .header {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  .sidebar .header-logo,
  .sidebar.fullscreen .header-logo {
    width: 65px !important;
  }

  .sidebar .header-content h1,
  .sidebar.fullscreen .header-content h1 {
    font-size: 13px !important;
  }

  .sidebar .header-content p,
  .sidebar.fullscreen .header-content p {
    font-size: 10px !important;
  }

  .sidebar .upload-zone,
  .sidebar.fullscreen .upload-zone {
    margin: 0 !important;
    margin-top: 12px !important;
    padding: 10px 12px !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    width: calc(100% - 24px) !important;
    margin-left: 12px !important;
    margin-right: 12px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
  }

  .sidebar .upload-zone .upload-icon,
  .sidebar.fullscreen .upload-zone .upload-icon {
    gap: 0 !important;
  }

  .sidebar .upload-zone .upload-icon img,
  .sidebar.fullscreen .upload-zone .upload-icon img {
    width: 38px !important;
    height: 38px !important;
  }

  .sidebar .upload-zone .upload-text,
  .sidebar.fullscreen .upload-zone .upload-text {
    font-size: 18px !important;
  }

  .sidebar .upload-zone .upload-hint,
  .sidebar.fullscreen .upload-zone .upload-hint {
    font-size: 11px !important;
  }

  .sidebar .documents-section,
  .sidebar.fullscreen .documents-section {
    padding: 12px !important;
  }

  .view-document-btn {
    width: 40px !important;
    min-width: 40px !important;
    font-size: 16px !important;
  }

  .sidebar .chat-input,
  .sidebar.fullscreen .chat-input {
    font-size: 16px !important;
    line-height: 22px !important;
  }

  .send-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    font-size: 0 !important;
  }

  .sidebar .chat-section,
  .sidebar.fullscreen .chat-section {
    max-width: 100% !important;
  }

  .sidebar .chat-messages,
  .sidebar.fullscreen .chat-messages {
    overflow-y: auto !important;
    overflow-x: auto !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .message {
    max-width: 95% !important;
    min-width: 0 !important;
  }
}

/* ============================================================================ */
/* MOBILE DOCUMENT VIEW                                                          */
/* ============================================================================ */

.mobile-document-view .sidebar {
  display: none !important;
}

.mobile-document-view .main-content {
  display: flex !important;
  flex-direction: column !important;
  border-radius: 0;
  width: 100% !important;
  min-height: 100vh !important;
  overflow: hidden !important;
}

@supports (-webkit-touch-callout: none) {
  .mobile-document-view .main-content {
    min-height: -webkit-fill-available !important;
  }
}

.mobile-document-view .content-header {
  flex-shrink: 0 !important;
}

.mobile-document-view .document-viewer {
  flex: 1 1 !important;
  padding: 0 !important;
  width: 100% !important;
  min-height: 400px !important;
}

.mobile-document-view #documentIframe {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

.mobile-document-view .zoom-control {
  display: flex !important;
}

/* ============================================================================ */
/* POLICY MODAL                                                                   */
/* ============================================================================ */

.policy-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000000;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
  height: var(--app-height);
  max-height: var(--app-height);
  padding: calc(var(--modal-side-padding) + env(safe-area-inset-top))
    calc(var(--modal-side-padding) + env(safe-area-inset-right))
    calc(var(--modal-side-padding) + env(safe-area-inset-bottom))
    calc(var(--modal-side-padding) + env(safe-area-inset-left));
}

.policy-modal {
  background: white;
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: min(85vh, calc(var(--app-height) - 40px));
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Policy modal header - sticky */
.policy-modal-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}

.policy-modal-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
}

.policy-modal-content {
  padding: 24px 32px 32px;
  overflow-y: auto;
  flex: 1 1;
}

.policy-modal-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.policy-modal-content h2:first-child {
  margin-top: 0;
}

.policy-modal-content p {
  font-size: 14px;
  line-height: 1.7;
  color: #444;
  margin-bottom: 12px;
}

.policy-modal-content ul {
  margin: 12px 0;
  padding-left: 24px;
}

.policy-modal-content li {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  margin-bottom: 8px;
}

.policy-modal-content a {
  color: var(--primary);
  text-decoration: underline;
}

.policy-modal-content a:hover {
  color: var(--secondary);
}

.policy-modal-content .policy-date {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: #999;
  font-style: italic;
}

.policy-modal-content .offer-intro {
  text-align: center;
  margin-bottom: 24px;
}

.policy-modal-content .offer-intro-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}

.policy-modal-content .offer-intro-subtitle {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  margin-bottom: 4px;
}

.policy-page {
  position: fixed;
  inset: 0;
  background: #fff;
  overflow-y: auto;
  z-index: 1000001;
  padding: 48px 20px 80px;
}

.policy-page-title {
  max-width: 860px;
  margin: 0 auto 24px;
  font-size: 26px;
  font-weight: 600;
  color: var(--primary);
}

.policy-page .policy-modal-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
}

@media (max-width: 600px) {
  .policy-modal {
    max-height: min(90vh, calc(var(--app-height) - 40px));
    border-radius: 12px;
  }

  .policy-modal-header {
    padding: 16px 20px;
  }

  .policy-modal-header h1 {
    font-size: 16px;
  }

  .policy-modal-content {
    padding: 20px;
  }

  .policy-modal-content h2 {
    font-size: 16px;
  }

  .policy-modal-content .offer-intro-title {
    font-size: 16px;
  }

  .policy-modal-content .offer-intro-subtitle {
    font-size: 13px;
  }

  .policy-page {
    padding: 32px 16px 56px;
  }

  .policy-page-title {
    font-size: 20px;
    margin-bottom: 20px;
  }
}

/* ============================================================================ */
/* GLOBAL MODAL CLOSE BUTTON                                                      */
/* ============================================================================ */

.modal-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: #e0e0e0;
  color: #333;
}

/* ============================================================================ */
/* GLOBAL MODAL STRUCTURE                                                         */
/* Use .modal-header + .modal-body for sticky header with scrollable content     */
/* ============================================================================ */

/* Modal header - sticky at top, contains close button and optional back button */
.modal-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

/* Back button in modal header */
.modal-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  padding: 6px 10px;
  margin: -6px -10px;
  border-radius: 6px;
  transition: background 0.2s;
}

.modal-back-btn:hover {
  background: #f3f4f6;
}

/* Modal body - scrollable content area */
.modal-body {
  flex: 1 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
}

/* Modal footer - sticky at bottom for action buttons (optional) */
.modal-footer {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: white;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* Base modal container that uses the header/body structure */
.modal-container {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-height: min(90vh, calc(var(--app-height) - 40px));
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

/* ============================================================================ */
/* SETTINGS MODALS                                                                */
/* ============================================================================ */

.settings-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
  height: var(--app-height);
  max-height: var(--app-height);
  padding: calc(var(--modal-side-padding) + env(safe-area-inset-top))
    calc(var(--modal-side-padding) + env(safe-area-inset-right))
    calc(var(--modal-side-padding) + env(safe-area-inset-bottom))
    calc(var(--modal-side-padding) + env(safe-area-inset-left));
}

.settings-modal {
  background: white;
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  max-height: calc(var(--app-height) - 40px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
  --primary: #fea768;
  --secondary: #f08f52;
}

.settings-modal-scroll {
  flex: 1 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.settings-modal-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
  background: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}

.settings-modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
}

/* Uses global .modal-close-btn styles */

.settings-modal-content {
  flex: 1 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
}

/* ============================================================================ */
/* HOW TO USE VIDEO MODAL                                                       */
/* ============================================================================ */

.video-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
  height: var(--app-height);
  max-height: var(--app-height);
  padding: calc(var(--modal-side-padding) + env(safe-area-inset-top))
    calc(var(--modal-side-padding) + env(safe-area-inset-right))
    calc(var(--modal-side-padding) + env(safe-area-inset-bottom))
    calc(var(--modal-side-padding) + env(safe-area-inset-left));
}

.video-modal {
  background: white;
  border-radius: 16px;
  max-width: 860px;
  width: 100%;
  max-height: calc(var(--app-height) - 40px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
}

.video-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 12px;
}

.video-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dark);
}

.video-modal-title h2 {
  font-size: 18px;
  font-weight: 600;
}

.video-modal-content {
  padding: 0 24px 24px;
}

.video-modal-player {
  width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  background: #111827;
}

.settings-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

.settings-success {
  background: #f0fdf4;
  color: #16a34a;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-field {
  margin-bottom: 20px;
}

.settings-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.settings-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.settings-input-wrapper.disabled {
  background: #f9fafb;
  cursor: not-allowed;
}

.settings-input-wrapper svg {
  color: #999;
  flex-shrink: 0;
}

.settings-input-wrapper input {
  flex: 1 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--dark);
  background: transparent;
}

.settings-input-wrapper input[type="date"] {
  font-family: inherit;
}

.settings-input-wrapper input[type="date"]::-webkit-date-and-time-value,
.settings-input-wrapper input[type="date"]::-webkit-datetime-edit {
  font-size: inherit;
  font-family: inherit;
}

.settings-input-wrapper input:disabled {
  color: #666;
  cursor: not-allowed;
}

.settings-modal .settings-input-wrapper:focus-within {
  box-shadow: 0 0 0 3px rgba(254, 167, 104, 0.25);
}

.settings-phone-input {
  width: 100%;
  --react-international-phone-height: 44px;
  --react-international-phone-border-radius: 10px;
  --react-international-phone-border-color: var(--border);
  --react-international-phone-background-color: #fff;
  --react-international-phone-text-color: var(--dark);
  --react-international-phone-country-selector-background-color: #fff;
  --react-international-phone-country-selector-background-color-hover: #f7f7f7;
  --react-international-phone-dropdown-shadow: 0 16px 28px rgba(20, 20, 20, 0.15);
  --react-international-phone-dropdown-item-font-size: 13px;
}

.settings-phone-input .react-international-phone-input-container {
  width: 100%;
}

.settings-phone-input .react-international-phone-input {
  font-size: 14px;
  padding: 0 12px;
  color: var(--dark);
  width: 100%;
  min-width: 0;
}

.settings-phone-input .react-international-phone-country-selector-button {
  padding: 0 10px;
}

.settings-phone-input:focus-within {
  --react-international-phone-border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(254, 167, 104, 0.25);
  border-radius: 10px;
}

.settings-modal .settings-btn-primary {
  color: #2d1f14;
}

.settings-toggle-password {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-toggle-password:hover {
  color: #666;
}

.settings-field-hint {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}

.settings-field-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 6px;
}

.settings-field-success {
  font-size: 12px;
  color: #16a34a;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.settings-btn-secondary {
  flex: 1 1;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-btn-secondary:hover {
  background: #f5f5f5;
  color: #333;
}

.settings-btn-primary {
  flex: 1 1;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.settings-btn-primary:hover:not(:disabled) {
  background: var(--secondary);
}

.settings-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 500px) {
  .settings-modal-actions {
    flex-direction: column;
  }
}

/* Settings Modal - Large variant */
.settings-modal-large {
  max-width: 600px;
}

.settings-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #666;
  gap: 16px;
}

.settings-section {
  margin-bottom: 32px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.settings-section-title svg {
  flex-shrink: 0;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 16px;
  gap: 16px;
}

@media (max-width: 500px) {
  .settings-row {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
  }

  .settings-row .settings-field {
    margin-bottom: 0;
  }
}

.settings-select-wrapper {
  position: relative;
}

.settings-select-wrapper select {
  width: 100%;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background: transparent;
  border: none;
  padding-right: 30px;
  cursor: pointer;
  color: var(--dark);
  -webkit-text-fill-color: var(--dark);
  font-size: 14px;
  line-height: 1.4;
}

.settings-select-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  pointer-events: none;
}

.settings-section-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  transition: all 0.2s;
}

.settings-section-toggle:hover {
  background: #f0f0f0;
}

.settings-section-toggle span {
  flex: 1 1;
  text-align: left;
}

.settings-toggle-icon {
  transition: transform 0.2s;
}

.settings-toggle-icon.open {
  transform: rotate(180deg);
}

.settings-org-fields {
  margin-top: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Settings Modal - Verification Code */
.settings-description {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-bottom: 16px;
}

.settings-code-input {
  text-align: center;
  font-size: 24px !important;
  font-weight: 600;
  letter-spacing: 10px;
  padding-left: 20px !important;
}

.settings-code-input::placeholder {
  letter-spacing: 10px;
  font-weight: 400;
  color: #ccc;
}

.settings-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: #666;
}

.settings-timer svg {
  color: var(--primary);
}

.settings-timer-warning {
  color: var(--error) !important;
}

.settings-timer:has(.settings-timer-warning) svg {
  color: var(--error);
}

.settings-resend-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  margin-top: 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: transparent;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-resend-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(102, 126, 234, 0.05);
}

.settings-modal .settings-resend-btn:hover:not(:disabled) {
  background: rgba(254, 167, 104, 0.12);
}

.settings-resend-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.settings-resend-btn svg {
  transition: transform 0.3s;
}

.settings-resend-btn:hover:not(:disabled) svg {
  transform: rotate(180deg);
}

/* ============================================================================ */
/* COOKIE BANNER                                                                  */
/* ============================================================================ */

.cookie-banner-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  display: flex;
  justify-content: center;
  padding: 20px;
  animation: slideUp 0.4s ease;
}

.cookie-banner-overlay::before {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(380px, 60vh, 720px);
  background: linear-gradient(
    to top,
    rgba(16, 24, 40, 0.45) 0%,
    rgba(16, 24, 40, 0.3) 35%,
    rgba(16, 24, 40, 0.18) 55%,
    rgba(16, 24, 40, 0.08) 70%,
    rgba(16, 24, 40, 0) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 65%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, #000 65%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.cookie-banner {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: 16px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  max-width: 700px;
  width: 100%;
  padding: 20px 24px;
}

.cookie-banner-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.cookie-banner-icon {
  font-size: 32px;
  color: var(--warning);
  flex-shrink: 0;
}

.cookie-banner-icon svg {
  display: block;
}

.cookie-banner-text h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.cookie-banner-text p {
  font-size: 13px;
  line-height: 1.5;
  color: #666;
  margin: 0;
}

.cookie-settings {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cookie-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.cookie-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.cookie-option input[type="checkbox"]:disabled {
  opacity: 0.6;
}

.cookie-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cookie-option-text strong {
  font-size: 13px;
  color: var(--dark);
}

.cookie-option-text small {
  font-size: 11px;
  color: #888;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.cookie-btn-settings {
  background: #f0f0f0;
  color: #666;
}

.cookie-btn-settings:hover {
  background: #e0e0e0;
}

.cookie-btn-necessary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.cookie-btn-necessary:hover {
  background: rgba(67, 97, 238, 0.05);
}

.cookie-btn-accept {
  background: var(--primary);
  color: white;
}

.cookie-btn-accept:hover {
  background: var(--secondary);
  transform: translateY(-1px);
}

.cookie-btn-icon {
  background: #f5f5f5;
  color: #888;
  padding: 10px 12px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.cookie-btn-icon:hover {
  background: #e8e8e8;
  color: #666;
}

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

.cookie-policy-link {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  color: #999;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.cookie-policy-link:hover {
  color: var(--primary);
}

.cookie-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cookie-banner-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.cookie-banner-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  transition: all 0.2s;
}

.cookie-banner-close:hover {
  background: #e8e8e8;
  color: #333;
}

.cookie-banner-close svg {
  margin: 0;
  font-size: 14px;
}

.cookie-policy-content {
  max-height: 300px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: #444;
  padding-right: 8px;
}

.cookie-policy-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  margin: 16px 0 8px;
}

.cookie-policy-content h4:first-child {
  margin-top: 0;
}

.cookie-policy-content p {
  margin-bottom: 8px;
}

.cookie-policy-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.cookie-policy-content li {
  margin-bottom: 4px;
}

.cookie-policy-content a {
  color: var(--primary);
  text-decoration: underline;
}

.cookie-policy-content .policy-date {
  margin-top: 16px;
  font-size: 11px;
  color: #999;
  font-style: italic;
}

@media (max-width: 600px) {
  .cookie-banner-overlay {
    padding: 12px;
  }

  .cookie-banner {
    padding: 16px;
    border-radius: 12px;
  }

  .cookie-banner-content {
    flex-direction: column;
    gap: 12px;
  }

  .cookie-banner-icon {
    font-size: 28px;
  }

  .cookie-banner-actions {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
    text-align: center;
  }
}

/* ============================================================================ */
/* AUTH PAGES                                                                    */
/* ============================================================================ */

/* Hide GlobalHeader on auth pages */
body:has(.auth-page) .global-header {
  display: none;
}

body:has(.auth-page) {
  padding-top: 0;
}

body:has(.auth-page) .container {
  height: auto;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 20px 20px;
  position: relative;
}

@media (max-width: 768px) {
  .auth-page {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* Auth Back Button - static position, no scroll follow */
.auth-back-link {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 10;
}

.auth-back-link:hover {
  background: rgba(255, 255, 255, 0.25);
}

.auth-back-link svg {
  width: 18px;
  height: 18px;
}

.auth-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 24px;
}

.auth-logo span {
  font-size: 18px;
}

.auth-logo i {
  font-size: 28px;
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.auth-header p {
  color: #666;
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 14px;
  font-weight: 500;
  color: #444;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrapper .auth-input-icon {
  position: absolute;
  left: 14px;
  color: #999;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.auth-toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.auth-toggle-password:hover {
  color: #666;
}

.auth-toggle-password svg {
  width: 18px;
  height: 18px;
}

.auth-field-error {
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
}

.auth-options {
  display: flex;
  justify-content: flex-end;
  margin-top: -16px;
}

.auth-page-login .auth-options {
  margin-top: -9px;
}

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

.auth-forgot:hover {
  text-decoration: underline;
}

.auth-submit {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s, transform 0.1s;
}

.auth-submit:hover:not(:disabled) {
  background: var(--secondary);
}

.auth-submit:active:not(:disabled) {
  transform: scale(0.98);
}

.auth-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  color: #999;
  font-size: 13px;
}

.auth-social {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 12px;
  gap: 12px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.auth-social-btn img {
  width: 20px !important;
  height: 20px !important;
  object-fit: contain;
  flex-shrink: 0;
}

.auth-social-btn:hover {
  background: #f8f9fa;
  border-color: #ccc;
}

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

.auth-social-yandex {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
  gap: 14px;
}

.auth-social-yandex img {
  width: 32px !important;
  height: 32px !important;
}

.auth-social-yandex:hover {
  background: #111;
  border-color: transparent;
}

.auth-social-yandex:active {
  background: #090909;
}

.auth-social-yandex:disabled {
  background: #111;
}

.auth-social-vk {
  color: #0077ff;
}

.auth-social-mailru {
  color: #005ff9;
}

.auth-social-ok {
  color: #ee8208;
}

/* Auth Agreement Text */
.auth-agreement {
  text-align: center;
  font-size: 12px;
  color: #7a7a7a;
  margin-top: 16px;
  line-height: 1.5;
}

.auth-agreement button {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: #555;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.auth-agreement button:hover {
  color: var(--primary);
}

@media (max-width: 767px) {
  .auth-agreement {
    font-size: 13px;
  }

  .auth-agreement button {
    font-size: 13px;
  }
}

.auth-footer {
  text-align: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.auth-footer p {
  color: #666;
  font-size: 14px;
}

.auth-footer a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Auth Success Message */
.auth-success-message {
  text-align: center;
  padding: 24px 0;
}

.auth-success-message svg {
  color: var(--success);
  margin-bottom: 16px;
}

.auth-success-message h2 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.auth-success-message p {
  color: #666;
  font-size: 14px;
  margin-bottom: 8px;
}

.auth-success-message strong {
  color: #333;
}

.auth-success-note {
  font-size: 13px;
  color: #999;
  margin-bottom: 24px !important;
}

.auth-success-message .auth-submit {
  display: inline-flex;
  text-decoration: none;
}

/* Auth Loading State */
.auth-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 0;
}

.auth-loading svg {
  color: var(--primary);
}

/* Auth Logo Image */
.auth-logo-image {
  border-radius: 8px;
  object-fit: contain;
  width: auto !important;
  height: 35px !important;
}

/* Auth Wizard Progress */
.auth-wizard .auth-header {
  margin-bottom: 24px;
}

.auth-progress {
  margin: 18px 0 20px;
  position: relative;
}

.auth-progress-bar {
  height: 3px;
  background: #e7eaf2;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0;
}

.auth-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.25s ease;
}

.auth-progress-steps {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  padding: 0 6px;
  pointer-events: none;
}

.auth-progress-step {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  background: #fff;
  color: #9aa3b2;
  border: 1px solid #d8dfee;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.auth-progress-step.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.auth-progress-step.completed {
  background: #95a7f0;
  border-color: #95a7f0;
  color: white;
}

/* Auth Step */
.auth-step {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.3s ease;
}

.auth-page-login .auth-step {
  gap: 16px;
}

.auth-step > .auth-submit {
  margin-top: 0;
}

.auth-page-login .auth-step > .auth-submit {
  margin-top: 4px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.auth-step-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.auth-back-btn {
  flex: 1 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: #666;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-back-btn:hover {
  background: #f8f9fa;
  border-color: #ccc;
}

.auth-step-buttons .auth-submit {
  flex: 2 1;
}

.auth-field-success {
  color: #27ae60;
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Verification Code Input */
.auth-code-input {
  text-align: center;
  font-size: 28px !important;
  font-weight: 600;
  letter-spacing: 12px;
  padding-left: 24px !important;
}

.auth-code-input::placeholder {
  letter-spacing: 12px;
  font-weight: 400;
  color: #ccc;
}

/* Timer */
.auth-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: #666;
}

.auth-timer svg {
  color: var(--primary);
}

.auth-timer-warning {
  color: var(--error) !important;
}

.auth-timer-warning + .auth-timer svg,
.auth-timer:has(.auth-timer-warning) svg {
  color: var(--error);
}

/* Resend Code Button */
.auth-resend-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  margin-top: 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: transparent;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-resend-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(102, 126, 234, 0.05);
}

.auth-resend-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-resend-btn svg {
  transition: transform 0.3s;
}

.auth-resend-btn:hover:not(:disabled) svg {
  transform: rotate(180deg);
}

/* Auth Error with Lucide */
.auth-error {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-error svg {
  flex-shrink: 0;
}

/* Auth Submit with Lucide */
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-submit svg {
  flex-shrink: 0;
}

/* Animate spin for Lucide */
.animate-spin {
  animation: spin 1s linear infinite;
}

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

/* Password Strength */
.password-strength {
  margin-top: 8px;
}

.password-strength-bar {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.password-strength-fill {
  height: 100%;
  transition: width 0.3s, background-color 0.3s;
}

.password-strength-label {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}

.password-requirements {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 4px;
  gap: 4px;
}

.password-requirements li {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.password-requirements .requirement-met {
  color: #27ae60;
}

.password-requirements .requirement-unmet {
  color: #999;
}

.password-requirements li svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Thumble auth redesign */
body:has(.auth-page.thumble-auth) {
  --bg-warm: #f6efe5;
  --bg-cool: #e9f2ff;
  --ink: #141517;
  --muted: #5a606b;
  --accent: #ff5a3d;
  --accent-soft: #ffb36f;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(13, 16, 22, 0.08);
  --shadow: 0 18px 38px rgba(14, 22, 36, 0.12);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 170, 120, 0.35), transparent 45%),
    radial-gradient(circle at 88% 18%, rgba(110, 169, 238, 0.25), transparent 40%),
    linear-gradient(120deg, var(--bg-warm), var(--bg-cool) 60%, #f8efe7);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  min-height: 100vh;
}

body:has(.auth-page.thumble-auth)::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(13, 16, 22, 0.03),
    rgba(13, 16, 22, 0.03) 1px,
    transparent 1px,
    transparent 8px
  );
  opacity: 0.5;
  pointer-events: none;
}

body:has(.auth-page.thumble-auth) h1,
body:has(.auth-page.thumble-auth) h2,
body:has(.auth-page.thumble-auth) h3,
body:has(.auth-page.thumble-auth) h4 {
  font-family: 'Space Grotesk', sans-serif;
}

.auth-page.thumble-auth {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: clamp(48px, 8vw, 96px) 24px;
}

.auth-page.thumble-auth .auth-back-link {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--panel-border);
  box-shadow: 0 12px 24px rgba(14, 22, 36, 0.12);
}

.auth-page.thumble-auth .auth-back-link:hover {
  background: rgba(255, 255, 255, 0.9);
}

.thumble-auth-layout {
  width: min(1200px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  grid-gap: clamp(32px, 6vw, 72px);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.thumble-auth-rail {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(10px, 2vw, 24px) 0;
}

.thumble-auth-rail .thumb-badge {
  background: rgba(255, 90, 61, 0.15);
  color: #b03822;
}

.thumble-auth-rail h1 {
  font-size: clamp(34px, 3.5vw, 52px);
  margin: 0;
}

.thumble-auth-rail p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 40ch;
  margin: 0;
}

.thumble-auth-points {
  display: grid;
  grid-gap: 16px;
  gap: 16px;
  margin-top: 8px;
}

.thumble-auth-points > div {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 14px 28px rgba(14, 22, 36, 0.08);
}

.thumble-auth-points strong {
  font-size: 15px;
  color: var(--ink);
}

.thumble-auth-points span {
  font-size: 14px;
  color: var(--muted);
}

.auth-page.thumble-auth .auth-container {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  max-width: 560px;
  width: 100%;
  padding: clamp(28px, 4vw, 48px);
  justify-self: center;
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}

.auth-page.thumble-auth .auth-header {
  text-align: left;
  margin-bottom: 24px;
}

.auth-page.thumble-auth .auth-header h1 {
  font-size: clamp(26px, 2.6vw, 34px);
  margin-bottom: 6px;
}

.auth-page.thumble-auth .auth-header p {
  font-size: 15px;
  color: var(--muted);
}

.auth-page.thumble-auth .auth-form {
  gap: 22px;
}

.auth-page.thumble-auth .auth-input-wrapper input {
  border-radius: 12px;
  padding: 14px 16px 14px 46px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(13, 16, 22, 0.12);
}

.auth-page.thumble-auth .auth-input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 61, 0.2);
}

.auth-page.thumble-auth .auth-toggle-password {
  color: #7b8290;
}

.auth-page.thumble-auth .auth-submit {
  border-radius: 999px;
  padding: 16px 26px;
  font-size: 16px;
  background: linear-gradient(135deg, #ff5a3d 0%, #ff8a4c 55%, #ffb36f 100%);
  box-shadow: 0 12px 24px rgba(255, 90, 61, 0.25);
}

.auth-page.thumble-auth .auth-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff6a47 0%, #ff944f 55%, #ffc07a 100%);
}

.auth-page.thumble-auth .auth-submit:disabled {
  background: #d6d6d6;
  box-shadow: none;
}

.auth-page.thumble-auth .auth-back-btn {
  border-radius: 999px;
  border-color: rgba(13, 16, 22, 0.12);
  background: rgba(255, 255, 255, 0.8);
}

.auth-page.thumble-auth .auth-step-buttons {
  gap: 16px;
}

.auth-page.thumble-auth .auth-agreement {
  text-align: left;
  font-size: 13px;
  color: var(--muted);
}

.auth-page.thumble-auth .auth-footer {
  text-align: left;
  border-top-color: var(--panel-border);
}

.auth-page.thumble-auth .auth-footer p {
  color: var(--muted);
  font-size: 14px;
}

.auth-page.thumble-auth .auth-progress-bar {
  background: rgba(13, 16, 22, 0.08);
}

.auth-page.thumble-auth .auth-progress-step {
  border-color: rgba(13, 16, 22, 0.18);
}

@media (max-width: 980px) {
  .auth-page.thumble-auth {
    padding: 72px 20px 40px;
  }

  .auth-page.thumble-auth .auth-container {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .auth-page.thumble-auth {
    padding: 56px 16px 32px;
  }
}

/* ============================================================================ */
/* GLOBAL HEADER                                                                 */
/* ============================================================================ */

.global-header {
  position: relative;
  height: 56px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10000;
}

.global-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-auth-placeholder {
  width: 200px;
  height: 36px;
}

.global-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.header-btn-primary {
  background: linear-gradient(135deg, #34d399 0%, #22c55e 50%, #1aaf51 100%);
  color: white;
  border: none;
  box-shadow: none;
}

.header-btn-primary:hover {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 50%, #159a47 100%);
  box-shadow: none;
  transform: translateY(-1px);
}

.header-btn-outline {
  background: white;
  color: #333;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-btn-outline:hover {
  background: #f8f9fa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.header-btn-ghost {
  background: transparent;
  color: white;
  border: none;
  padding: 8px 12px;
}

.header-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.header-icon-btn {
  position: relative;
  background: transparent;
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.header-icon-btn i {
  font-size: 18px;
  margin: 0;
}

.header-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Profile Dropdown */
.profile-dropdown {
  position: relative;
  z-index: 9999;
}

.profile-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  color: #666;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-avatar-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 9999;
}

.profile-dropdown.open .profile-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--dark);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.profile-dropdown-item:hover {
  background: #f8f9fa;
}

.profile-dropdown-item i {
  color: #666;
  width: 16px;
  text-align: center;
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.profile-dropdown-item.logout {
  color: var(--danger);
}

.profile-dropdown-item.logout i {
  color: var(--danger);
}

/* Notifications Panel */
.notifications-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 360px;
  max-height: 480px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.notifications-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.notifications-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.notifications-header button {
  font-size: 13px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
}

.notifications-header button:hover {
  text-decoration: underline;
}

.notifications-list {
  max-height: 400px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.15s;
}

.notification-item:hover {
  background: #f8f9fa;
}

.notification-item.unread {
  background: #f0f7ff;
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-icon.success {
  background: #e8f5e9;
  color: #27ae60;
}

.notification-icon.info {
  background: #e3f2fd;
  color: #2196f3;
}

.notification-icon.warning {
  background: #fff3e0;
  color: #f57c00;
}

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

.notification-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 2px;
}

.notification-text {
  font-size: 13px;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}

.notifications-empty {
  padding: 40px 20px;
  text-align: center;
  color: #999;
}

.notifications-empty i {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
}

.mobile-menu-btn-desktop {
  display: flex;
}

.mobile-tariff-control {
  display: none;
}

.mobile-menu-overlay {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 12000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: white;
  transform: translateX(100%);
  transition: transform 0.3s;
  z-index: 12001;
  display: flex;
  flex-direction: column;
}

.mobile-menu-overlay.open .mobile-menu {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.mobile-menu-close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-content {
  flex: 1 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.mobile-menu-section {
  display: flex;
  flex-direction: column;
}

.mobile-menu-main .mobile-menu-item {
  font-size: 17px;
  font-weight: 600;
}

.mobile-menu-secondary .mobile-menu-item {
  font-size: 13px;
  color: #6b7280;
  padding: 12px 20px;
}

.mobile-menu-secondary {
  margin-top: auto;
  padding-top: 12px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.mobile-menu-secondary .mobile-menu-item svg,
.mobile-menu-secondary .mobile-menu-item i {
  color: #9ca3af;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  font-size: 16px;
  color: var(--dark);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.mobile-menu-item.mobile-menu-item-note {
  gap: 8px;
  margin: 10px 20px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(103, 101, 198, 0.08);
  color: #4b5563;
  width: calc(100% - 40px);
  cursor: default;
}

.mobile-menu-item.mobile-menu-item-note img {
  width: 20px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-menu-item.mobile-menu-item-note:hover,
.mobile-menu-item.mobile-menu-item-note:active {
  background: rgba(103, 101, 198, 0.08);
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
  background: #f8f9fa;
}

.mobile-menu-item svg {
  color: #666;
  flex-shrink: 0;
}

.mobile-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

@media (min-width: 961px) {
  .mobile-menu {
    left: auto;
    right: 0;
    width: min(360px, 92vw);
    border-left: 1px solid var(--border);
  }

  .mobile-menu-secondary {
    align-items: flex-start;
    text-align: left;
  }

  .mobile-menu-secondary .mobile-menu-item {
    justify-content: flex-start;
    text-align: left;
  }

  .mobile-menu-item.mobile-menu-item-note {
    align-self: flex-start;
    width: calc(100% - 40px);
    margin-left: 20px;
    margin-right: 20px;
  }
}

@media (max-width: 960px) {
  .global-header {
    padding: 0 12px;
  }

  .global-header-left .header-btn-primary,
  .global-header-left .header-btn-outline {
    padding: 6px 10px;
    font-size: 12px;
  }

  .global-header-right .header-btn-ghost,
  .global-header-right .header-icon-btn:not(.mobile-menu-btn) {
    display: none;
  }

  .global-header-right > .tariff-control {
    display: none;
  }

  .header-auth-placeholder {
    width: 120px;
  }

  .mobile-tariff-control {
    display: block;
  }

  .mobile-tariff-control .tariff-control {
    padding: 4px 8px;
    font-size: 12px;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .mobile-menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 12000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  .mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s;
    z-index: 12001;
    display: flex;
    flex-direction: column;
  }

  .mobile-menu-overlay.open .mobile-menu {
    transform: translateX(0);
  }

  .mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
  }

  .mobile-menu-header h3 {
    font-size: 18px;
    font-weight: 600;
  }

  .mobile-menu-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-content {
    flex: 1 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  .mobile-menu-section {
    display: flex;
    flex-direction: column;
  }

  .mobile-menu-main .mobile-menu-item {
    font-size: 17px;
    font-weight: 600;
  }

  .mobile-menu-secondary .mobile-menu-item {
    font-size: 13px;
    color: #6b7280;
    padding: 12px 20px;
  }

  .mobile-menu-secondary {
    margin-top: auto;
    padding-top: 12px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
  }

  .mobile-menu-secondary .mobile-menu-item svg,
  .mobile-menu-secondary .mobile-menu-item i {
    color: #9ca3af;
  }

  .mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    font-size: 16px;
    color: var(--dark);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
  }

  .mobile-menu-item.mobile-menu-item-note {
    gap: 8px;
    margin: 10px 20px 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(103, 101, 198, 0.08);
    color: #4b5563;
    width: calc(100% - 40px);
    cursor: default;
  }

  .mobile-menu-item.mobile-menu-item-note img {
    width: 20px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .mobile-menu-item.mobile-menu-item-note:hover,
  .mobile-menu-item.mobile-menu-item-note:active {
    background: rgba(103, 101, 198, 0.08);
  }

  .mobile-menu-item:hover,
  .mobile-menu-item:active {
    background: #f8f9fa;
  }

  .mobile-menu-item svg {
    color: #666;
    flex-shrink: 0;
  }

  .mobile-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
  }

  .notifications-panel {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
  }

  /* Mobile Inline Notifications */
  .mobile-notifications {
    background: transparent;
    padding: 0;
    margin: 0;
  }

  .mobile-notifications-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
    color: var(--dark);
    background: #f8f9fa;
  }

  .mobile-notifications-header svg {
    color: #666;
    flex-shrink: 0;
  }

  .mobile-notifications-badge {
    background: var(--danger);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
  }

  .mobile-notifications-read-all {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
  }

  .mobile-notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .mobile-notification-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
  }

  .mobile-notification-item.unread {
    background: #f0f7ff;
  }

  .mobile-notification-item .notification-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-notification-item .notification-icon.success {
    background: #dcfce7;
    color: #16a34a;
  }

  .mobile-notification-item .notification-icon.info {
    background: #dbeafe;
    color: #2563eb;
  }

  .mobile-notification-item .notification-icon.warning {
    background: #fef3c7;
    color: #d97706;
  }

  .mobile-notification-item .notification-content {
    flex: 1 1;
    min-width: 0;
  }

  .mobile-notification-item .notification-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 4px;
  }

  .mobile-notification-item .notification-text {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 6px;
  }

  .mobile-notification-item .notification-time {
    font-size: 13px;
    color: #999;
  }

  .mobile-notifications-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
  }

  .mobile-notifications-empty svg {
    margin-bottom: 12px;
  }

  .mobile-notifications-empty p {
    font-size: 15px;
  }
}

/* Adjust container for global header */
body.has-global-header {
  padding-top: 0;
}

body.has-global-header .container {
  height: calc(100vh - 56px - 40px);
}

@media (max-width: 1100px) {
  body.has-global-header .container {
    height: calc(var(--app-height) - 56px);
    min-height: calc(var(--app-height) - 56px) !important;
  }

  body.has-global-header .sidebar {
    min-height: 100% !important;
  }
}

/* ============================================================================ */
/* ANIMATED REGISTER BUTTON (Apple-style)                                        */
/* ============================================================================ */

.animated-register-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(135deg, #34d399 0%, #22c55e 50%, #1aaf51 100%);
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
  box-shadow: 0 4px 15px rgba(26, 175, 81, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.animated-register-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    #34d399,
    #22c55e,
    #4ade80,
    #16a34a,
    #34d399
  );
  background-size: 400% 400%;
  animation: gradient-shift 3s ease infinite;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

.animated-register-btn:hover::before {
  opacity: 1;
}

.animated-register-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 175, 81, 0.45);
}

.animated-register-btn:active {
  transform: translateY(0);
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Pulse glow effect */
.animated-register-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(26, 175, 81, 0.6);
  opacity: 0;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0;
  }
  50% {
    opacity: 0.6;
  }
}

/* ============================================================================ */
/* LIMIT POPUP                                                                   */
/* ============================================================================ */

.limit-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  height: var(--app-height);
  max-height: var(--app-height);
  padding: calc(var(--modal-side-padding) + env(safe-area-inset-top))
    calc(var(--modal-side-padding) + env(safe-area-inset-right))
    calc(var(--modal-side-padding) + env(safe-area-inset-bottom))
    calc(var(--modal-side-padding) + env(safe-area-inset-left));
  animation: fadeIn 0.2s ease;
  isolation: isolate;
}

.limit-popup {
  background: radial-gradient(circle at 20% 20%, rgba(252, 233, 255, 0.92), rgba(255, 255, 255, 0.96));
  border-radius: 18px;
  padding: 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.3s ease;
  border: 1px solid rgba(196, 133, 255, 0.35);
  box-shadow:
    0 12px 32px rgba(124, 58, 237, 0.14),
    0 0 18px rgba(244, 114, 182, 0.18);
  position: relative;
}

.limit-popup-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 16px;
}

.limit-popup-icon.warning {
  background: #f3e8ff;
  color: #a855f7;
}

.limit-popup-icon.lock {
  background: #f3e8ff;
  color: #a855f7;
}

.limit-popup h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 10px;
}

.limit-popup p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 20px;
}

.limit-popup-remaining {
  display: inline-block;
  background: rgba(248, 237, 255, 0.9);
  color: #8b5cf6;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
}

.limit-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.limit-popup-close-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: transparent;
  color: #9ca3af;
  padding: 0;
  cursor: pointer;
  line-height: 0;
}

.limit-popup .animated-register-btn {
  background: linear-gradient(135deg, #c084fc 0%, #8b5cf6 50%, #a855f7 100%);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
  overflow: visible;
}

.limit-popup .animated-register-btn::before {
  background: linear-gradient(135deg, #d6c1ff, #b794f6, #d6c1ff);
}

.limit-popup .animated-register-btn::after {
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
}

.limit-popup .animated-register-btn:hover {
  background: linear-gradient(135deg, #c9b3ff 0%, #8b5cf6 55%, #b077ff 100%);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.4);
}

.limit-popup .animated-register-btn:hover::before {
  opacity: 0.6;
}

.limit-popup-close {
  background: transparent;
  border: none;
  color: #999;
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
  margin-top: 8px;
}

.limit-popup-close:hover {
  color: #666;
}

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

/* Register Prompt in Chat */
.register-prompt {
  background: radial-gradient(circle at 20% 20%, rgba(252, 233, 255, 0.92), rgba(255, 255, 255, 0.96));
  border-radius: 18px;
  padding: 24px;
  margin: 16px 0;
  text-align: center;
  color: #1f2937;
  border: 1px solid rgba(196, 133, 255, 0.35);
  box-shadow:
    0 12px 32px rgba(124, 58, 237, 0.14),
    0 0 18px rgba(244, 114, 182, 0.18);
}

.register-prompt-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3e8ff;
  color: #a855f7;
  font-size: 20px;
  margin-bottom: 12px;
}

.register-prompt h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.register-prompt p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 20px;
}

.register-prompt .animated-register-btn {
  background: linear-gradient(135deg, #c084fc 0%, #8b5cf6 50%, #a855f7 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
  overflow: visible;
}

.register-prompt .animated-register-btn::before {
  background: linear-gradient(135deg, #d6c1ff, #b794f6, #d6c1ff);
}

.register-prompt .animated-register-btn::after {
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
}

.register-prompt .animated-register-btn:hover {
  background: linear-gradient(135deg, #c9b3ff 0%, #8b5cf6 55%, #b077ff 100%);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.4);
}

.register-prompt .animated-register-btn:hover::before {
  opacity: 0.6;
}

.register-btn-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(135deg, #f472b6, #c084fc);
  padding: 3px 8px;
  border-radius: 10px 10px 10px 2px;
  box-shadow: 0 6px 12px rgba(124, 58, 237, 0.25);
  text-transform: none;
  pointer-events: none;
  z-index: 2;
}

@media (max-width: 480px) {
  .auth-container {
    padding: 24px;
  }

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

  .password-requirements {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================ */
/* TARIFF CONTROL & MODAL                                                       */
/* ============================================================================ */

/* Tariff Control in Header */
.tariff-control {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(254, 167, 104, 0.18);
  border: 1px solid rgba(254, 167, 104, 0.4);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  color: #c45f1b;
  font-weight: 500;
}

.tariff-control:hover {
  background: rgba(254, 167, 104, 0.28);
  border-color: rgba(254, 167, 104, 0.6);
}

.tariff-control.premium {
  background: linear-gradient(135deg, #fea768 0%, #f28a4b 100%);
  border-color: #f28a4b;
  color: #2d1f14;
}

.tariff-control.premium:hover {
  background: linear-gradient(135deg, #ffb982 0%, #f59b62 100%);
}

.tariff-control-icon {
  flex-shrink: 0;
}

.tariff-control-balance {
  font-weight: 600;
}

.tariff-control-label {
  display: inline;
}

/* Tariff Modal Overlay */
.tariff-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--app-height);
  max-height: var(--app-height);
  padding: calc(var(--modal-side-padding) + env(safe-area-inset-top))
    calc(var(--modal-side-padding) + env(safe-area-inset-right))
    calc(var(--modal-side-padding) + env(safe-area-inset-bottom))
    calc(var(--modal-side-padding) + env(safe-area-inset-left));
  animation: fadeIn 0.2s ease;
  isolation: isolate;
}

/* Tariff Modal - uses global modal structure */
.tariff-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: min(90vh, calc(var(--app-height) - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
  z-index: 999999;
  --primary: #fea768;
  --secondary: #f08f52;
}

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

/* Tariff modal header - sticky */
.tariff-modal-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}

.tariff-modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tariff-modal-header-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

/* Back button uses global style */
.tariff-modal-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.tariff-modal-back:hover {
  text-decoration: underline;
}

/* Tariff modal body - scrollable content area */
.tariff-modal-body {
  flex: 1 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 32px 32px;
}

.tariff-modal-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #222;
}

.tariff-modal-subtitle {
  color: #666;
  margin-bottom: 24px;
}

.tariff-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  margin-bottom: 20px;
}

/* Current Subscription */
.tariff-current-subscription {
  background: linear-gradient(135deg, #fff5ed 0%, #ffe8d8 100%);
  border: 1px solid #ffd7b4;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.tariff-current-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--primary);
}

.tariff-current-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.tariff-current-info {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.tariff-current-plan,
.tariff-current-balance {
  display: flex;
  gap: 6px;
}

.tariff-current-plan .label,
.tariff-current-balance .label {
  color: #666;
}

.tariff-current-plan .value,
.tariff-current-balance .value {
  font-weight: 600;
  color: #222;
}

.tariff-current-expires {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
  font-size: 14px;
}

.tariff-cancel-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.tariff-cancel-btn:hover {
  background: #fecaca;
}

.tariff-org-reminder {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: #fef3c7;
  border-radius: 8px;
  color: #92400e;
  font-size: 13px;
  margin-bottom: 12px;
}

.tariff-renew-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: #2d1f14;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.tariff-renew-btn:hover {
  background: var(--secondary);
}

/* Tariff Plans Grid */
.tariff-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  grid-gap: 16px;
  gap: 16px;
}

.tariff-plan-card {
  position: relative;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.tariff-plan-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(254, 167, 104, 0.18);
}

.tariff-plan-card.popular {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(254, 167, 104, 0.24);
}

.tariff-plan-card.current {
  border-color: #f08f52;
  background: #fff7ee;
}

.tariff-plan-card.free {
  background: #f9fafb;
}

.tariff-popular-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

.tariff-current-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--secondary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

.tariff-plan-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #222;
}

.tariff-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.tariff-requests {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
}

.tariff-features {
  list-style: none;
  margin-bottom: 20px;
}

.tariff-features li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
  margin-bottom: 8px;
}

.tariff-features li svg {
  color: var(--primary);
  flex-shrink: 0;
}

.tariff-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tariff-btn.primary {
  background: var(--primary);
  border: none;
  color: #2d1f14;
}

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

.tariff-btn.secondary {
  background: white;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.tariff-btn.secondary:hover {
  background: #fff3e6;
}

.tariff-btn.danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-weight: 600;
}

.tariff-btn.danger:hover {
  background: #fee2e2;
}

.tariff-btn.disabled {
  background: #e5e7eb;
  border: none;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Payment Form */
.tariff-payment-form,
.tariff-corporate-form {
  max-width: 480px;
}

/* Removed old margin-bottom - redesigned modal uses gap in parent containers */

.tariff-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin: 20px 0;
  font-size: 14px;
  color: #444;
}

.tariff-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.tariff-org-fields {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  animation: fadeIn 0.2s ease;
}

.tariff-messenger-options {
  display: flex;
  gap: 20px;
}

.tariff-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
}

.tariff-radio input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.tariff-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: #2d1f14;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tariff-submit-btn:hover {
  background: var(--secondary);
}

.tariff-submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}


.tariff-qr-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}

.tariff-qr-warning svg {
  color: #d97706;
  flex-shrink: 0;
}

.tariff-qr-warning p {
  font-size: 13px;
  color: #92400e;
}

.tariff-qr-email-note {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.tariff-confirm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: #2d1f14;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}

.tariff-confirm-btn:hover {
  background: var(--secondary);
}

.tariff-confirm-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.tariff-confirm-hint {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

/* Cancel Payment Button */
.tariff-cancel-payment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid #f87171;
  border-radius: 8px;
  color: #dc2626;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.tariff-cancel-payment-btn:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.tariff-cancel-payment-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading Step */
.tariff-loading-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  min-height: 300px;
}

.tariff-loading-qr-animation {
  margin-bottom: 24px;
}

.qr-placeholder {
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.qr-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.qr-icon-pulse {
  color: #9ca3af;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1); }
}

.tariff-loading-message {
  font-size: 16px;
  color: #6b7280;
  font-weight: 500;
  animation: fadeInOut 1.5s ease-in-out;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* QR Payment Layout - Centered single column */
.tariff-qr-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.tariff-qr-step .tariff-modal-title {
  margin-bottom: 16px;
}

.tariff-qr-instruction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  color: #6b7280;
  text-align: left;
  white-space: nowrap;
}

.tariff-qr-instruction svg {
  flex-shrink: 0;
}

.tariff-qr-instruction p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.tariff-qr-code {
  background: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border: 1px solid #e5e7eb;
  margin-bottom: 24px;
}

.tariff-qr-code img {
  display: block;
}

.tariff-bank-details {
  width: 100%;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: left;
}

.tariff-bank-details h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #374151;
  text-align: center;
}

.tariff-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}

.tariff-detail-row:last-child {
  border-bottom: none;
}

.tariff-detail-row .label {
  color: #6b7280;
  min-width: 100px;
  flex-shrink: 0;
}

.tariff-detail-row .value {
  flex: 1 1;
  color: #1f2937;
  word-break: break-word;
}

.tariff-detail-row .value.highlight {
  font-weight: 600;
  color: var(--primary);
  font-size: 16px;
}

.tariff-detail-row .value.small {
  font-size: 13px;
}

.tariff-detail-row .copy-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tariff-detail-row .copy-btn:hover {
  color: var(--primary);
  background: #e5e7eb;
}

.tariff-qr-step .tariff-qr-warning {
  width: 100%;
}

.tariff-qr-step .tariff-confirm-btn {
  width: 100%;
}

.tariff-qr-step .tariff-confirm-hint {
  width: 100%;
}

/* Cancel subscription confirmation */
.tariff-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--app-height);
  max-height: var(--app-height);
  padding: calc(var(--modal-side-padding) + env(safe-area-inset-top))
    calc(var(--modal-side-padding) + env(safe-area-inset-right))
    calc(var(--modal-side-padding) + env(safe-area-inset-bottom))
    calc(var(--modal-side-padding) + env(safe-area-inset-left));
  z-index: 1000000;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}

.tariff-confirm-modal {
  background: radial-gradient(circle at 20% 20%, rgba(255, 248, 235, 0.9), rgba(255, 255, 255, 0.94));
  border-radius: 20px;
  padding: 26px;
  width: min(520px, 100%);
  border: 1px solid rgba(255, 200, 150, 0.4);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.18),
    0 0 35px rgba(255, 186, 118, 0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tariff-confirm-modal h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  color: #111827;
}

.tariff-confirm-text {
  margin: 0;
  color: #4b5563;
  line-height: 1.6;
  font-size: 14px;
}

.tariff-confirm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.tariff-confirm-headings {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tariff-confirm-subtitle {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.tariff-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.tariff-confirm-actions .tariff-btn {
  width: 100%;
  padding: 15px 18px;
  font-size: 15px;
  border-radius: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tariff-confirm-actions .tariff-btn.danger {
  background: linear-gradient(135deg, #f97070, #ef4444);
  border: none;
  color: #fff;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.25);
}

.tariff-confirm-actions .tariff-btn.danger:hover {
  background: linear-gradient(135deg, #fa8181, #f05252);
}

.tariff-confirm-actions .tariff-btn.secondary {
  background: linear-gradient(135deg, #fea768, #f08f52);
  border: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(254, 167, 104, 0.25);
}

.tariff-confirm-actions .tariff-btn.secondary:hover {
  background: linear-gradient(135deg, #ffb982, #f59b62);
}

.tariff-confirm-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tariff-confirm-icon.warning {
  background: #fff3d5;
  color: #d97706;
}

@media (min-width: 640px) {
  .tariff-confirm-modal {
    padding: 30px;
  }

  .tariff-confirm-actions {
    flex-direction: row;
  }

  .tariff-confirm-actions .tariff-btn {
    width: auto;
    flex: 1 1;
  }
}

/* Payment Tracking Step */
.tariff-tracking-step {
  padding: 20px 0;
  text-align: center;
}

.tariff-tracking-subtitle {
  color: #6b7280;
  margin-bottom: 32px;
}

.tariff-progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 32px;
  padding: 0 20px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.progress-step .step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  transition: all 0.3s;
}

.progress-step.completed .step-icon {
  background: var(--secondary);
  color: white;
}

.progress-step.active .step-icon {
  background: var(--primary);
  color: white;
}

.progress-step span {
  font-size: 12px;
  color: #6b7280;
  text-align: center;
  max-width: 80px;
}

.progress-step.completed span,
.progress-step.active span {
  color: #374151;
  font-weight: 500;
}

.progress-line {
  width: 40px;
  height: 2px;
  background: #e5e7eb;
  margin: 0 4px;
  margin-bottom: 20px;
}

.progress-line.completed {
  background: var(--secondary);
}

.tariff-tracking-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff3e6;
  border: 1px solid #ffd7b4;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  text-align: left;
}

.tariff-tracking-info svg {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.tariff-tracking-info p {
  font-size: 14px;
  color: #9a4c1f;
  line-height: 1.5;
}

/* Badge Styles for Plan Cards */
.tariff-badge.awaiting {
  background: #fef3c7;
  color: #b45309;
}

.tariff-badge.processing {
  background: #ffe8d6;
  color: #c45f1b;
}

/* Button variants */
.tariff-card-btn.secondary {
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tariff-card-btn.secondary:hover {
  background: #e27a3c;
}

.tariff-card-btn.outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tariff-card-btn.outline:hover {
  background: var(--primary);
  color: white;
}

/* Mobile responsive for payment tracking */
@media (max-width: 768px) {
  .tariff-progress-bar {
    flex-direction: column;
    gap: 8px;
  }

  .progress-line {
    width: 2px;
    height: 20px;
    margin: 0;
  }

  .progress-step {
    flex-direction: row;
    min-width: auto;
    width: 100%;
    justify-content: flex-start;
  }

  .progress-step span {
    max-width: none;
    text-align: left;
  }

  .tariff-detail-row .label {
    min-width: 80px;
  }
}

/* YooKassa Mock */
.tariff-yookassa-step {
  text-align: center;
  padding: 40px 0;
}

.tariff-yookassa-mock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.tariff-yookassa-mock svg {
  color: #9ca3af;
}

.tariff-yookassa-mock p {
  color: #666;
  margin-bottom: 20px;
}

/* Success Step */
.tariff-success-step {
  text-align: center;
  padding: 40px 0;
}

.tariff-success-icon {
  color: var(--primary);
  margin-bottom: 16px;
}

.tariff-success-step h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.tariff-success-step p {
  color: #666;
  margin-bottom: 8px;
}

.tariff-success-note {
  font-size: 14px;
  color: #888;
  margin-bottom: 24px !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .tariff-modal {
    max-height: min(95vh, calc(var(--app-height) - 40px));
    border-radius: 12px;
  }

  .tariff-modal-header {
    padding: 16px 20px;
  }

  .tariff-modal-body {
    padding: 20px 16px 24px;
  }

  .tariff-plans-grid {
    grid-template-columns: 1fr;
  }

  .tariff-current-info {
    flex-direction: column;
    gap: 8px;
  }

  .tariff-qr-instruction p {
    font-size: 12.5px;
  }
}

/* ============================================================================ */
/* REDESIGNED TARIFF MODAL                                                       */
/* ============================================================================ */

.tariff-modal-redesign {
  max-width: 960px;
}

.tariff-plans-redesign {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Current subscription / Trial block */
.tariff-current-block {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff5ed 0%, #ffe9d6 100%);
  border: 1px solid #ffd7b4;
}

.tariff-current-block.has-subscription {
  background: linear-gradient(135deg, #fff1e1 0%, #ffd9b9 100%);
  border-color: #fbb57a;
}

.tariff-current-block.trial {
  background: linear-gradient(135deg, #fef7f0 0%, #ffe4cf 100%);
  border-color: #f7c9a2;
}

.tariff-current-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fea768 0%, #f28a4b 100%);
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(254, 167, 104, 0.35);
}

.tariff-current-icon.trial {
  background: linear-gradient(135deg, #ffd0aa 0%, #fea768 100%);
  box-shadow: 0 4px 12px rgba(254, 167, 104, 0.3);
}

.tariff-current-content {
  flex: 1 1;
  min-width: 0;
}

.tariff-current-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.tariff-current-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.tariff-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #4b5563;
}

.tariff-stat svg {
  color: #6b7280;
}

.tariff-stat .days-left {
  color: #9ca3af;
  font-size: 13px;
}

.tariff-stat.expired {
  color: #dc2626;
}

.tariff-stat.expired svg {
  color: #dc2626;
}

.tariff-billing-alert {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
}

.tariff-billing-alert svg {
  color: #dc2626;
  flex-shrink: 0;
  margin-top: 2px;
}

.tariff-billing-alert-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tariff-billing-alert-text strong {
  font-weight: 600;
  font-size: 13px;
}

.tariff-current-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.tariff-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.tariff-action-btn.primary {
  background: var(--primary);
  color: #2d1f14;
}

.tariff-action-btn.primary:hover {
  background: var(--secondary);
}

.tariff-action-btn.danger {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.tariff-action-btn.danger:hover {
  background: #fecaca;
}

.tariff-action-btn.disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border: 1px solid #e5e7eb;
  cursor: default;
}

.tariff-action-btn.info {
  background: transparent;
  color: #d6732c;
  border: none;
  padding: 6px;
}

.tariff-action-btn.info:hover {
  background: transparent;
}

.tariff-cancelled-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tariff-tooltip-wrapper {
  position: relative;
}

.tariff-tooltip {
  position: absolute;
  top: 110%;
  right: 0;
  background: #1f2937;
  color: #f9fafb;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  width: 230px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateY(4px);
  z-index: 5;
}

.tariff-tooltip.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tariff-tooltip-wrapper:hover .tariff-tooltip,
.tariff-tooltip-wrapper:focus-within .tariff-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tariff-trial-hint {
  font-size: 13px;
  color: #d6732c;
  font-weight: 500;
  flex-shrink: 0;
}

/* Tariff cards grid - 3 columns */
.tariff-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 20px;
  gap: 20px;
}

.tariff-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  transition: all 0.25s ease;
}

.tariff-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(254, 167, 104, 0.2);
  transform: translateY(-4px);
}

.tariff-card.popular {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(254, 167, 104, 0.2);
}

.tariff-card.current {
  border-color: #f08f52;
  background: #fff7ee;
}

.tariff-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tariff-badge.popular {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #2d1f14;
}

.tariff-badge.current {
  background: var(--secondary);
  color: white;
}

.tariff-card-name {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 12px;
  text-align: center;
}

.tariff-card-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 16px;
}

.tariff-card-price .price {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
}

.tariff-card-price .currency {
  font-size: 16px;
  color: #6b7280;
}

.tariff-card-requests {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, #fff3e6 0%, #ffe0c7 100%);
  border-radius: 10px;
  margin-bottom: 20px;
}

.tariff-card-requests svg {
  color: var(--primary);
}

.tariff-card-requests span {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

.tariff-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  flex: 1 1;
}

.tariff-card-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #4b5563;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.tariff-card-features li:last-child {
  border-bottom: none;
}

.tariff-card-features li svg {
  color: #f08f52;
  flex-shrink: 0;
  margin-top: 2px;
}

.tariff-card-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--primary);
  color: #2d1f14;
  border: none;
}

.tariff-card-btn:hover {
  background: var(--secondary);
}

.tariff-card-btn.disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Corporate block - horizontal */
.tariff-corporate-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  background: linear-gradient(135deg, #fff5ed 0%, #ffe8d8 100%);
  border: 2px solid #ffd7b4;
  border-radius: 16px;
}

.tariff-corporate-info {
  flex: 1 1;
}

.tariff-corporate-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.tariff-corporate-header svg {
  color: var(--primary);
  margin-top: 2px;
  flex-shrink: 0;
}

.tariff-corporate-header > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tariff-corporate-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.3;
}

.tariff-corporate-price {
  font-size: 14px;
  color: #c45f1b;
  display: block;
}

.tariff-corporate-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tariff-corporate-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #4b5563;
}

.tariff-corporate-features li svg {
  color: var(--primary);
  flex-shrink: 0;
}

.tariff-corporate-btn {
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--primary);
  color: #2d1f14;
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 4px;
}

.tariff-corporate-btn:hover {
  background: var(--secondary);
}

/* Form step - centered layout */
.tariff-form-step {
  max-width: 560px;
  margin: 0 auto;
}

.tariff-form-header {
  text-align: center;
  margin-bottom: 28px;
}

.tariff-form-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.tariff-form-header p {
  font-size: 15px;
  color: #6b7280;
}

.tariff-form-plan {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, #fff5ed 0%, #ffe8d8 100%);
  border-radius: 8px;
  color: var(--primary);
  font-weight: 500;
  margin-top: 12px;
}

.tariff-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tariff-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 16px;
  gap: 16px;
}

.tariff-form-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.tariff-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tariff-form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.tariff-form-group input {
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s;
}

.tariff-form-group input.input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
  background: #fff1f2;
}

.tariff-form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(254, 167, 104, 0.2);
}

.tariff-field-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
}

.tariff-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.tariff-checkbox-label.input-error {
  border-color: #ef4444;
  background: #fff1f2;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.tariff-checkbox-label:hover {
  background: #f3f4f6;
}

.tariff-checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.tariff-checkbox-text {
  font-size: 14px;
  color: #374151;
}

.tariff-consent {
  margin-top: 6px;
}

.tariff-consent-label {
  align-items: flex-start;
}

.tariff-consent-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.35;
}

.tariff-consent-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.tariff-consent-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.tariff-required,
.tariff-consent-required {
  color: #f59e0b;
  margin-left: 4px;
  font-weight: 600;
}

.tariff-consent-note {
  font-size: 12px;
  color: #6b7280;
  white-space: pre-line;
}

.tariff-org-section {
  padding: 20px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tariff-org-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Messenger radio buttons - card style */
.tariff-messenger-group {
  display: flex;
  gap: 12px;
}

.tariff-radio-card {
  flex: 1 1;
  position: relative;
  cursor: pointer;
}

.tariff-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tariff-radio-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.2s;
}

.tariff-radio-card input[type="radio"]:checked + .tariff-radio-content {
  border-color: var(--primary);
  background: #fff4e9;
}

.tariff-radio-card:hover .tariff-radio-content {
  border-color: #ffd7b4;
}

.tariff-radio-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tariff-radio-indicator::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.2s;
}

.tariff-radio-card input[type="radio"]:checked + .tariff-radio-content .tariff-radio-indicator {
  border-color: var(--primary);
}

.tariff-radio-card input[type="radio"]:checked + .tariff-radio-content .tariff-radio-indicator::after {
  background: var(--primary);
}

.tariff-radio-label {
  font-size: 15px;
  font-weight: 500;
  color: #374151;
}

/* Redesigned modal mobile responsive */
@media (max-width: 900px) {
  .tariff-cards-grid {
    grid-template-columns: 1fr;
  }

  .tariff-corporate-block {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }

  .tariff-corporate-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .tariff-corporate-header {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
  }

  .tariff-corporate-header > div {
    align-items: center;
  }

  .tariff-corporate-header svg {
    margin-top: 0;
  }

  .tariff-corporate-features {
    justify-content: center;
  }

  .tariff-corporate-btn {
    align-self: center;
    margin-top: 0;
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 640px) {
  .tariff-current-block {
    flex-direction: column;
    text-align: center;
    padding: 16px;
  }

  .tariff-current-stats {
    justify-content: center;
    text-align: center;
    margin-top: 14px;
  }

  .tariff-current-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .tariff-trial-hint {
    margin-top: 8px;
  }

  .tariff-form-row,
  .tariff-form-row-3 {
    grid-template-columns: 1fr;
  }

  .tariff-messenger-group {
    flex-direction: column;
  }
}

@media (max-width: 1100px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="date"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  textarea,
  select,
  .settings-select-wrapper select {
    font-size: 16px;
  }

  .chat-input {
    font-size: 16px;
    line-height: 22px;
  }
}

@media (max-width: 1100px) {
  .sidebar.documents-panel-collapsed .documents-panel-wrapper {
    max-height: 0 !important;
    margin: 0 !important;
    pointer-events: none !important;
    transform: translateY(-18px) !important;
  }
}

/* ============================================================================ */
/* THUMBLEYT LANDING THEME                                                     */
/* ============================================================================ */

body:has(.thumble-theme) {
  --bg-warm: #f6efe5;
  --bg-cool: #e9f2ff;
  --ink: #141517;
  --muted: #5a606b;
  --accent: #ff5a3d;
  --accent-soft: #ffb36f;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-border: rgba(13, 16, 22, 0.08);
  --shadow: 0 18px 38px rgba(14, 22, 36, 0.12);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 170, 120, 0.35), transparent 45%),
    radial-gradient(circle at 88% 18%, rgba(110, 169, 238, 0.25), transparent 40%),
    linear-gradient(120deg, var(--bg-warm), var(--bg-cool) 60%, #f8efe7);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  min-height: 100vh;
  padding: 0;
}

body:has(.thumble-theme)::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(13, 16, 22, 0.03),
    rgba(13, 16, 22, 0.03) 1px,
    transparent 1px,
    transparent 8px
  );
  opacity: 0.5;
  pointer-events: none;
}

body:has(.thumble-theme) button,
body:has(.thumble-theme) a,
body:has(.thumble-theme) input {
  font-family: inherit;
}

body:has(.thumble-theme) h1,
body:has(.thumble-theme) h2,
body:has(.thumble-theme) h3,
body:has(.thumble-theme) h4 {
  font-family: 'Space Grotesk', sans-serif;
}

body:has(.thumble-theme) .global-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid var(--panel-border);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  padding: 0 clamp(24px, 4vw, 64px);
}

body:has(.thumble-theme) .global-header-left,
body:has(.thumble-theme) .global-header-right {
  gap: 16px;
}

body:has(.thumble-theme) .header-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.95rem;
}

body:has(.thumble-theme) .header-btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-soft));
  color: #1b120f;
  box-shadow: 0 10px 24px rgba(255, 90, 61, 0.2);
}

body:has(.thumble-theme) .header-btn-outline {
  border: 1px solid rgba(13, 16, 22, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

body:has(.thumble-theme) .header-btn-ghost {
  color: var(--ink);
  background: rgba(20, 21, 23, 0.06);
  border: 1px solid transparent;
}

body:has(.thumble-theme) .header-btn-ghost:hover {
  background: rgba(20, 21, 23, 0.12);
}

body:has(.thumble-theme) .header-icon-btn,
body:has(.thumble-theme) .profile-avatar-btn {
  color: var(--ink);
}

body:has(.thumble-theme) .mobile-menu {
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
}

body:has(.thumble-theme) .mobile-menu-item {
  color: var(--ink);
}

body:has(.thumble-theme) .mobile-menu-item:hover,
body:has(.thumble-theme) .mobile-menu-item:active {
  background: rgba(20, 21, 23, 0.06);
}

body:has(.thumble-theme) .footer {
  background: transparent;
  color: var(--ink);
  padding: 24px clamp(24px, 4vw, 64px);
  font-size: 0.85rem;
}

body:has(.thumble-theme) .footer-links a {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--panel-border);
  padding: 8px 14px;
  font-size: 0.85rem;
}

body:has(.thumble-theme) .footer-links a:hover {
  background: rgba(255, 255, 255, 0.9);
}

body:has(.thumble-theme) .footer-server {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--panel-border);
}

.thumb-landing {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(36px, 5vw, 64px) clamp(24px, 6vw, 96px) 140px;
  display: grid;
  grid-gap: clamp(48px, 6vw, 96px);
  gap: clamp(48px, 6vw, 96px);
  position: relative;
  z-index: 1;
}

.thumb-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 90, 61, 0.12);
  color: #b03822;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.thumb-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  grid-gap: 36px;
  gap: 36px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  padding: 48px;
  box-shadow: var(--shadow);
}

.thumb-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.thumb-hero-copy h1 {
  font-size: clamp(36px, 4vw, 56px);
  margin: 0;
}

.thumb-hero-copy p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.05rem;
  max-width: 860px;
}

.thumb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.thumb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thumb-btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-soft));
  color: #1b120f;
  box-shadow: 0 12px 24px rgba(255, 90, 61, 0.18);
}

.thumb-btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--panel-border);
  color: var(--ink);
}

.thumb-btn:hover {
  transform: translateY(-1px);
}

.thumb-status {
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(20, 21, 23, 0.05);
  border: 1px solid rgba(20, 21, 23, 0.08);
  font-size: 0.95rem;
}

.thumb-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 16px;
  gap: 16px;
  margin-top: 8px;
}

.thumb-metric {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
  grid-gap: 4px;
  gap: 4px;
}

.metric-value {
  font-weight: 700;
  font-size: 1.05rem;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.thumb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.thumb-tags span {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--panel-border);
}

.thumb-hero-ui {
  display: grid;
  grid-gap: 20px;
  gap: 20px;
}

.thumb-ui-card {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.thumb-ui-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f6f6f6;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.85rem;
}

.thumb-ui-logo {
  font-weight: 700;
  color: #ff1f1f;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.thumb-ui-input {
  flex: 1 1;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #dedede;
  background: #ffffff;
  font-size: 0.85rem;
  color: #2b2f36;
}

.thumb-ui-btn {
  background: #1c1f23;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.thumb-ui-results {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  margin-top: 16px;
}

.thumb-ui-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #ececec;
  border-radius: 16px;
  padding: 12px;
  background: #ffffff;
}

.thumb-ui-item img {
  width: 160px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.thumb-ui-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.thumb-ui-meta {
  font-size: 0.8rem;
  color: #6a6f76;
}

.thumb-ui-item.is-target {
  border-color: rgba(255, 90, 61, 0.5);
  box-shadow: 0 8px 18px rgba(255, 90, 61, 0.16);
}

.thumb-ui-chip {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  color: #b03822;
  background: rgba(255, 90, 61, 0.15);
  padding: 4px 10px;
  border-radius: 999px;
}

.thumb-ui-status {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #6a6f76;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 90, 61, 0.08);
  border: 1px solid rgba(255, 90, 61, 0.2);
}

.thumb-preview-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 16px;
  gap: 16px;
}

.thumb-preview {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.thumb-preview img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.thumb-section {
  display: grid;
  grid-gap: 28px;
  gap: 28px;
  scroll-margin-top: 90px;
}

.thumb-section-head h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  margin: 0;
}

.thumb-section-head p {
  color: var(--muted);
  font-size: 1rem;
}

.thumb-step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-gap: 20px;
  gap: 20px;
}

.thumb-step-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  padding: 20px;
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  box-shadow: var(--shadow);
}

.thumb-step-number {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: rgba(255, 90, 61, 0.15);
  color: #b03822;
}

.thumb-showcase {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.thumb-showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  grid-gap: 36px;
  gap: 36px;
  align-items: center;
}

.thumb-showcase p {
  color: var(--muted);
  line-height: 1.6;
}

.thumb-checklist {
  list-style: none;
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  margin: 24px 0 20px;
  padding: 0;
}

.thumb-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.thumb-checklist li::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.thumb-gallery {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.thumb-gallery img {
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--panel-border);
  background: #fff;
}

.thumb-showcase-media {
  display: grid;
  grid-gap: 18px;
  gap: 18px;
}

.thumb-showcase-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  padding: 16px;
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.thumb-showcase-card img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.thumb-showcase-card.is-highlight {
  border-color: rgba(255, 90, 61, 0.4);
  box-shadow: 0 12px 26px rgba(255, 90, 61, 0.2);
}

.thumb-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-gap: 20px;
  gap: 20px;
}

.thumb-feature-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.thumb-feature-card h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.thumb-feature-card p {
  color: var(--muted);
  line-height: 1.5;
}

.thumb-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px;
  border-radius: 28px;
  border: 1px solid rgba(255, 90, 61, 0.3);
  background: linear-gradient(
    120deg,
    rgba(255, 90, 61, 0.12),
    rgba(255, 179, 111, 0.35)
  );
  box-shadow: var(--shadow);
}

.thumb-cta h2 {
  font-size: clamp(26px, 3vw, 38px);
  margin: 8px 0 6px;
}

.thumb-cta p {
  color: var(--muted);
}

.thumb-cta-actions {
  display: flex;
  gap: 12px;
}

@media (max-width: 960px) {
  .thumb-hero {
    grid-template-columns: 1fr;
  }

  .thumb-showcase-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .thumb-metrics {
    grid-template-columns: 1fr;
  }

  .thumb-preview-card {
    grid-template-columns: 1fr;
  }

  .thumb-ui-item img {
    width: 100%;
  }

  .thumb-ui-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .thumb-ui-chip {
    margin-left: 0;
  }
}

/* ============================================================================ */
/* THUMBLE MVP DEMO                                                            */
/* ============================================================================ */

.thumb-mvp {
  --shadow: 0 20px 40px rgba(14, 22, 36, 0.08);
  position: relative;
  z-index: 1;
}

.thumb-mvp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.thumb-mvp-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.thumb-mvp-badge {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 90, 61, 0.12);
  color: #b03822;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.thumb-mvp-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 3vw, 3.2rem);
  margin: 0;
}

.thumb-mvp-hero p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.thumb-mvp-top-grid {
  display: grid;
  grid-gap: 24px;
  gap: 24px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: stretch;
}

.thumb-mvp-panel-fill {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.thumb-mvp-panel-wide {
  margin-top: 24px;
}

.thumb-mvp-panel-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1;
}

.thumb-mvp-panel-fill .thumb-mvp-status {
  margin-top: 16px;
}

.thumb-mvp-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  animation: thumb-mvp-float-in 0.6s ease both;
}

.thumb-mvp-panel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.thumb-mvp-youtube-shell {
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e6e6e6;
}

.thumb-mvp-yt-topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: #f6f6f6;
  border-bottom: 1px solid #e8e8e8;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1;
}

.thumb-mvp-yt-logo {
  font-weight: 700;
  color: #ff1f1f;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.thumb-mvp-yt-search {
  flex: 1 1;
  display: flex;
  gap: 6px;
  align-items: center;
}

.thumb-mvp-yt-search input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d7d7d7;
  font-size: 0.9rem;
  background: #ffffff;
}

.thumb-mvp-yt-search button {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #1c1f23;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.thumb-mvp-yt-search button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.thumb-mvp-yt-actions {
  font-size: 0.8rem;
  color: #6b6f76;
}

.thumb-mvp-yt-results {
  max-height: 420px;
  min-height: 320px;
  overflow-y: auto;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.thumb-mvp-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6a6f76;
}

.thumb-mvp-history-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 90, 61, 0.12);
  color: #b03822;
  font-size: 0.72rem;
  font-weight: 600;
}

.thumb-mvp-yt-empty {
  padding: 48px 12px;
  text-align: center;
  color: #8a9098;
  font-size: 0.9rem;
}

.thumb-mvp-yt-list {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.thumb-mvp-yt-results.has-results .thumb-mvp-yt-list {
  display: flex;
}

.thumb-mvp-yt-results.has-results .thumb-mvp-yt-empty {
  display: none;
}

.thumb-mvp-yt-result {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid #ececec;
  padding: 10px;
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.thumb-mvp-yt-result:hover {
  border-color: rgba(255, 90, 61, 0.5);
  box-shadow: 0 8px 18px rgba(255, 90, 61, 0.12);
  transform: translateY(-1px);
}

.thumb-mvp-yt-result.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 90, 61, 0.2);
}

.thumb-mvp-yt-thumb-wrap {
  width: 160px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: #f1f1f1;
}

.thumb-mvp-yt-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-mvp-yt-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 6px;
}

.thumb-mvp-yt-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.thumb-mvp-yt-title {
  font-weight: 600;
  font-size: 0.98rem;
}

.thumb-mvp-yt-channel,
.thumb-mvp-yt-stats {
  color: #6a6f76;
  font-size: 0.82rem;
}

.thumb-mvp-status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(13, 16, 22, 0.08);
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
}

.thumb-mvp-status-title {
  font-weight: 600;
}

.thumb-mvp-status-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(13, 16, 22, 0.08);
  overflow: hidden;
}

.thumb-mvp-status-bar span {
  display: block;
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  transform: translateX(-120%);
}

.thumb-mvp-status-loading .thumb-mvp-status-bar span {
  animation: thumb-mvp-loading 1.2s ease-in-out infinite;
}

.thumb-mvp-status-success .thumb-mvp-status-bar span {
  width: 100%;
  transform: translateX(0);
  animation: none;
}

.thumb-mvp-status-warn {
  border-color: rgba(255, 152, 59, 0.5);
  background: rgba(255, 236, 213, 0.7);
}

.thumb-mvp-status-success {
  border-color: rgba(56, 179, 89, 0.5);
  background: rgba(228, 248, 235, 0.8);
}

.thumb-mvp-face-grid {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.thumb-mvp-face-card {
  border-radius: 16px;
  border: 1px solid rgba(13, 16, 22, 0.1);
  padding: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  position: relative;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.thumb-mvp-face-card img {
  width: 100%;
  border-radius: 12px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.thumb-mvp-face-name {
  font-weight: 600;
}

.thumb-mvp-face-meta {
  font-size: 0.8rem;
  color: #6a6f76;
}

.thumb-mvp-face-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 90, 61, 0.18);
}

.thumb-mvp-face-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 999px;
}

.thumb-mvp-upload-card {
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #6a6f76;
  min-height: 240px;
  border: 2px dashed var(--accent);
}

.thumb-mvp-upload-card input {
  display: none;
}

.thumb-mvp-upload-card.drag {
  border-color: var(--accent);
  background: rgba(255, 90, 61, 0.08);
}

.thumb-mvp-upload-card.has-preview img {
  display: block;
}

.thumb-mvp-upload-card.has-preview .thumb-mvp-upload-ui {
  display: none;
}

.thumb-mvp-upload-ui {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.thumb-mvp-upload-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 90, 61, 0.12);
  color: var(--accent);
  font-size: 24px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 4px;
}

.thumb-mvp-preview-grid {
  display: grid;
  grid-gap: 16px;
  gap: 16px;
}

.thumb-mvp-preview-grid-horizontal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.thumb-mvp-preview-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thumb-mvp-preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  font-size: 0.9rem;
}

.thumb-mvp-download-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(13, 16, 22, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: #b03822;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.thumb-mvp-download-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(14, 22, 36, 0.12);
  background: #ffffff;
}

.thumb-mvp-download-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.thumb-mvp-preview-frame {
  border-radius: 16px;
  border: 1px solid rgba(13, 16, 22, 0.12);
  background: #ffffff;
  padding: 10px;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.thumb-mvp-preview-frame img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.thumb-mvp-placeholder {
  color: #6a6f76;
  font-size: 0.9rem;
}

.thumb-mvp-preview-frame.thumb-mvp-output img {
  filter: blur(18px);
  transform: scale(1.02);
  opacity: 0.7;
}

.thumb-mvp-preview-frame.thumb-mvp-output.is-generating img {
  animation: thumb-mvp-reveal 5s ease-out forwards;
}

.thumb-mvp-preview-frame.thumb-mvp-output.is-complete img {
  filter: blur(0);
  opacity: 1;
  transform: scale(1);
}

.thumb-mvp-output-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  background: rgba(20, 22, 26, 0.35);
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.thumb-mvp-output-overlay.active {
  opacity: 1;
}

.thumb-mvp-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  animation: thumb-mvp-spin 1s linear infinite;
}

.thumb-mvp-generate-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(120deg, var(--accent), var(--accent-soft));
  color: #1b120f;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thumb-mvp-generate-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.thumb-mvp-generate-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(255, 90, 61, 0.22);
}

.thumb-mvp-prompt {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thumb-mvp-prompt label {
  font-weight: 600;
  font-size: 0.9rem;
}

.thumb-mvp-prompt textarea {
  width: 100%;
  resize: vertical;
  min-height: 90px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(13, 16, 22, 0.16);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.thumb-mvp-prompt textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 61, 0.18);
}

.thumb-mvp-footer {
  margin-top: 32px;
  text-align: center;
  color: #6a6f76;
  font-size: 0.85rem;
}

@keyframes thumb-mvp-float-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes thumb-mvp-loading {
  0% {
    transform: translateX(-120%);
  }
  50% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes thumb-mvp-reveal {
  0% {
    filter: blur(18px);
    opacity: 0.6;
  }
  70% {
    filter: blur(4px);
    opacity: 0.9;
  }
  100% {
    filter: blur(0);
    opacity: 1;
  }
}

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

@media (max-width: 980px) {
  .thumb-mvp-top-grid {
    grid-template-columns: 1fr;
  }

  .thumb-mvp-preview-grid-horizontal {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .thumb-mvp-yt-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .thumb-mvp-yt-actions {
    text-align: right;
  }

  .thumb-mvp-yt-result {
    flex-direction: column;
    align-items: flex-start;
  }

  .thumb-mvp-yt-thumb-wrap {
    width: 100%;
  }
}

/*!***************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./node_modules/react-international-phone/dist/index.css ***!
  \***************************************************************************************************************************************************************************************************************************************************************************************************/
.react-international-phone-country-selector{position:relative}.react-international-phone-country-selector-button{display:flex;height:var(--react-international-phone-height, 36px);box-sizing:border-box;align-items:center;justify-content:center;padding:0;border:1px solid var(--react-international-phone-country-selector-border-color, var(--react-international-phone-border-color, gainsboro));margin:0;-moz-appearance:button;appearance:button;-webkit-appearance:button;background-color:var(--react-international-phone-country-selector-background-color, var(--react-international-phone-background-color, white));cursor:pointer;text-transform:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-international-phone-country-selector-button:hover{background-color:var(--react-international-phone-country-selector-background-color-hover, whitesmoke)}.react-international-phone-country-selector-button--hide-dropdown{cursor:auto}.react-international-phone-country-selector-button--hide-dropdown:hover{background-color:transparent}.react-international-phone-country-selector-button__button-content{display:flex;align-items:center;justify-content:center}.react-international-phone-country-selector-button__flag-emoji{margin:0 4px}.react-international-phone-country-selector-button__flag-emoji--disabled{opacity:.75}.react-international-phone-country-selector-button__dropdown-arrow{border-top:var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777);border-right:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;border-left:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;margin-right:4px;transition:all .1s ease-out}.react-international-phone-country-selector-button__dropdown-arrow--active{transform:rotateX(180deg)}.react-international-phone-country-selector-button__dropdown-arrow--disabled{border-top-color:var(--react-international-phone-disabled-country-selector-arrow-color, #999)}.react-international-phone-country-selector-button--disabled{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));cursor:auto}.react-international-phone-country-selector-button--disabled:hover{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke))}.react-international-phone-flag-emoji{width:var(--react-international-phone-flag-width, 24px);height:var(--react-international-phone-flag-height, 24px);box-sizing:border-box}.react-international-phone-country-selector-dropdown{position:absolute;z-index:1;top:var(--react-international-phone-dropdown-top, 44px);left:var(--react-international-phone-dropdown-left, 0);display:flex;width:300px;max-height:200px;flex-direction:column;padding:4px 0;margin:0;background-color:var(--react-international-phone-dropdown-item-background-color, var(--react-international-phone-background-color, white));box-shadow:var(--react-international-phone-dropdown-shadow, 2px 2px 16px rgba(0, 0, 0, .25));color:var(--react-international-phone-dropdown-item-text-color, var(--react-international-phone-text-color, #222));list-style:none;overflow-y:scroll}.react-international-phone-country-selector-dropdown__preferred-list-divider{height:1px;border:none;margin:var(--react-international-phone-dropdown-preferred-list-divider-margin, 0);background:var(--react-international-phone-dropdown-preferred-list-divider-color, var(--react-international-phone-border-color, gainsboro))}.react-international-phone-country-selector-dropdown__list-item{display:flex;min-height:var(--react-international-phone-dropdown-item-height, 28px);box-sizing:border-box;align-items:center;padding:2px 8px}.react-international-phone-country-selector-dropdown__list-item-flag-emoji{margin-right:8px}.react-international-phone-country-selector-dropdown__list-item-country-name{overflow:hidden;margin-right:8px;font-size:var(--react-international-phone-dropdown-item-font-size, 14px);text-overflow:ellipsis;white-space:nowrap}.react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-dropdown-item-dial-code-color, gray);font-size:var(--react-international-phone-dropdown-item-font-size, 14px)}.react-international-phone-country-selector-dropdown__list-item:hover{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));cursor:pointer}.react-international-phone-country-selector-dropdown__list-item--selected,.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke);color:var(--react-international-phone-selected-dropdown-item-text-color, var(--react-international-phone-text-color, #222))}.react-international-phone-country-selector-dropdown__list-item--selected .react-international-phone-country-selector-dropdown__list-item-dial-code,.react-international-phone-country-selector-dropdown__list-item--focused .react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-selected-dropdown-item-dial-code-color, var(--react-international-phone-dropdown-item-dial-code-color, gray))}.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke))}.react-international-phone-dial-code-preview{display:flex;align-items:center;justify-content:center;padding:0 8px;border:1px solid var(--react-international-phone-dial-code-preview-border-color, var(--react-international-phone-border-color, gainsboro));margin-right:-1px;background-color:var(--react-international-phone-dial-code-preview-background-color, var(--react-international-phone-background-color, white));color:var(--react-international-phone-dial-code-preview-text-color, var(--react-international-phone-text-color, #222));font-size:var(--react-international-phone-dial-code-preview-font-size, var(--react-international-phone-font-size, 13px))}.react-international-phone-dial-code-preview--disabled{background-color:var(--react-international-phone-dial-code-preview-disabled-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));color:var(--react-international-phone-dial-code-preview-disabled-text-color, var(--react-international-phone-disabled-text-color, #666))}.react-international-phone-input-container{display:flex}.react-international-phone-input-container .react-international-phone-country-selector-button{border-radius:var(--react-international-phone-border-radius, 4px);margin-right:-1px;border-bottom-right-radius:0;border-top-right-radius:0}.react-international-phone-input-container .react-international-phone-input{overflow:visible;height:var(--react-international-phone-height, 36px);box-sizing:border-box;padding:0 8px;border:1px solid var(--react-international-phone-border-color, gainsboro);border-radius:var(--react-international-phone-border-radius, 4px);margin:0;background-color:var(--react-international-phone-background-color, white);border-bottom-left-radius:0;border-top-left-radius:0;color:var(--react-international-phone-text-color, #222);font-family:inherit;font-size:var(--react-international-phone-font-size, 13px)}.react-international-phone-input-container .react-international-phone-input:focus{outline:none}.react-international-phone-input-container .react-international-phone-input--disabled{background-color:var(--react-international-phone-disabled-background-color, whitesmoke);color:var(--react-international-phone-disabled-text-color, #666)}

