:root {
  --mamino-peach: #ffd6c7;
  --mamino-pink: #ffb7e0;
  --mamino-lavender: #d5c6ff;
  --mamino-blue: #c7e0ff;
  --mamino-bg: #fdf8f6;
  --mamino-text-main: #2e2434;
  --mamino-text-soft: #7a6b86;
  --mamino-border-soft: #f0e1da;
  --mamino-shadow-soft: 0 10px 30px rgba(217, 169, 191, 0.25);
}

html {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #ffe2ed 0, #fdf8f6 50%, #f7fbff 100%);
  color: var(--mamino-text-main);
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Шапка */

.app-header {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(239, 222, 223, 0.8);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-logo-wrap {
  width: 40px;
  height: 40px;
  border-radius: 18px;
  background: radial-gradient(circle at 20% 0, #ffe3f1, #ffd9c9 40%, #cbe3ff 100%);
  padding: 4px;
  box-shadow: 0 6px 16px rgba(202, 151, 182, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #b08ad6;
}

.brand-tagline {
  font-size: 11px;
  color: var(--mamino-text-soft);
  max-width: 190px;
}

.user-info {
  text-align: right;
  max-width: 220px;
}

.user-name {
  font-size: 12px;
  font-weight: 500;
}

.user-label {
  font-size: 11px;
  color: var(--mamino-text-soft);
}

/* Основной контент */

.app-main {
  flex: 1;
  overflow: hidden;
}

.screen {
  display: none;
  overflow-y: auto;
}

.screen-active {
  display: block;
}

.screen-inner {
  padding: 10px 14px 72px;
}

.screen-title {
  font-size: 18px;
  margin: 0 0 6px;
}

.screen-desc {
  font-size: 13px;
  margin: 0 0 10px;
  color: var(--mamino-text-soft);
}

/* Hero */

.hero {
  border-radius: 22px;
  padding: 14px 12px 12px;
  background: radial-gradient(circle at 0 0, #ffe4f2 0, #ffd9c7 35%, #cde3ff 100%);
  box-shadow: var(--mamino-shadow-soft);
  margin-bottom: 10px;
  color: #3b2235;
}

.hero-content {
  max-width: 100%;
}

.hero-chip {
  display: inline-flex;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #b06c97;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-title {
  font-size: 19px;
  margin: 6px 0 4px;
}

.hero-text {
  font-size: 13px;
  margin: 0;
  color: #4d3845;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
}

.hero-highlights span {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
}

/* Общие блоки */

.section-title {
  font-size: 14px;
  margin: 10px 0 6px;
}

/* Быстрые темы */

.quick-issues {
  margin-bottom: 14px;
}

.quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-chip {
  border-radius: 999px;
  border: 1px solid #f4d4e6;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.05s ease, box-shadow 0.12s ease;
}

.quick-chip:hover {
  background: #ffe8f2;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(195, 133, 169, 0.25);
}

.primary-cta {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #ffb7e0, #d6c6ff);
  color: #3b2235;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--mamino-shadow-soft);
}

.primary-cta:active {
  transform: translateY(1px);
  box-shadow: 0 6px 18px rgba(196, 140, 169, 0.4);
}

.cta-note {
  font-size: 11px;
  color: var(--mamino-text-soft);
  margin-top: 4px;
}

/* Каталог сегментов */

.catalog {
  margin-top: 4px;
}

.segments-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.segment-card {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--mamino-border-soft);
  overflow: hidden;
}

.segment-header {
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.segment-main {
  display: flex;
  flex-direction: column;
}

.segment-title {
  font-size: 14px;
  font-weight: 600;
}

.segment-subtitle {
  font-size: 11px;
  color: var(--mamino-text-soft);
}

.segment-toggle {
  font-size: 18px;
  color: #baa1d0;
}

.segment-body {
  padding: 5px 10px 8px;
  border-top: 1px solid #f3e3dd;
  display: none;
}

.segment-body-open {
  display: block;
}

.assistant-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.assistant-item {
  border-radius: 12px;
  background: linear-gradient(135deg, #fef9ff, #f9f3ff);
  border: 1px solid #ecddff;
  padding: 6px 8px;
}

.assistant-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.assistant-title {
  font-size: 13px;
  font-weight: 600;
}

.assistant-pill {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f0e7ff;
  color: #62488f;
}

.assistant-desc {
  font-size: 12px;
  color: var(--mamino-text-soft);
  margin-top: 3px;
}

/* Избранное */

.empty-state {
  margin-top: 16px;
  padding: 16px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px dashed #e0cfff;
  text-align: center;
}

.empty-icon {
  font-size: 28px;
}

.empty-title {
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
}

.empty-text {
  font-size: 12px;
  color: var(--mamino-text-soft);
  margin-top: 4px;
}

.hidden {
  display: none !important;
}

/* Профиль */

.profile-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--mamino-border-soft);
  margin-bottom: 10px;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 18px;
  background: radial-gradient(circle at 20% 0, #ffe4f0, #d5c6ff 60%, #c7e0ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3b2235;
  font-weight: 700;
  font-size: 20px;
}

.profile-main {
  flex: 1;
}

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

.profile-note {
  font-size: 12px;
  color: var(--mamino-text-soft);
  margin-top: 2px;
}

.profile-section {
  margin-top: 10px;
}

.profile-section-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 4px;
}

.profile-menu {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--mamino-border-soft);
  overflow: hidden;
}

.profile-item {
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.profile-item + .profile-item {
  border-top: 1px solid #f2e4da;
}

.profile-item-tag {
  font-size: 11px;
  color: #aa8bd2;
}

/* Квиз */

.back-btn {
  border: none;
  background: transparent;
  font-size: 13px;
  color: #8a74c5;
  padding: 0;
  margin-bottom: 6px;
  cursor: pointer;
}

.quiz-form {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-question {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--mamino-border-soft);
}

.quiz-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.quiz-options label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.quiz-select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e1cfe0;
  padding: 6px 8px;
  font-size: 13px;
}

/* Результат */

.result-card {
  margin-top: 8px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e4d3ff;
}

.result-segment {
  font-size: 11px;
  color: #8c7da7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-assistant-name {
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
}

.result-explainer {
  font-size: 13px;
  color: var(--mamino-text-soft);
  margin-top: 6px;
}

.result-steps {
  margin-top: 8px;
  padding-left: 18px;
  font-size: 12px;
  color: #65556f;
}

.secondary-cta {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d8c6f7;
  background: #f7f2ff;
  color: #5f4d9c;
  font-size: 13px;
  cursor: pointer;
}

.result-actions {
  margin-top: 10px;
}

.result-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--mamino-text-soft);
}

/* Нижняя навигация */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(240, 225, 218, 0.9);
  display: flex;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #8b8093;
  cursor: pointer;
}

.nav-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-label {
  margin-top: 2px;
}

.nav-item-active {
  color: #7c5ed8;
}

/* Статус-бар */

.status-bar {
  position: fixed;
  bottom: 54px;
  left: 0;
  right: 0;
  min-height: 20px;
  padding: 2px 10px;
  background: rgba(247, 238, 252, 0.96);
  border-top: 1px solid #ebddf6;
  font-size: 11px;
  color: #6f5c7c;
}

/* Мобильная адаптация */

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-tagline {
    max-width: 100%;
  }

  .user-info {
    text-align: left;
    max-width: 100%;
  }

  .screen-inner {
    padding-bottom: 80px;
  }
}

/* ===== ANDROID FIXES ===== */

body.is-android #app {
  min-height: 100vh;
}

body.is-android .app-main {
  overflow: visible;
}

body.is-android .screen {
  overflow: visible;
}

body.is-android .bottom-nav {
  position: static;
  height: auto;
  margin-top: 8px;
}

body.is-android .status-bar {
  position: static;
  border-top: none;
}
