/* ===== CSS VARIABLES ===== */
:root {
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --border: #E2E8F0;
  --border-active: #818CF8;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;
  --accent: #6366F1;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --accent-glow: rgba(99, 102, 241, 0.2);
  --sage: #10B981;
  --sage-light: rgba(16, 185, 129, 0.15);
  --rose: #EF4444;
  --rose-light: rgba(239, 68, 68, 0.15);
  --lavender: #6366F1;
  --lavender-light: rgba(99, 102, 241, 0.15);
  --peach: #F59E0B;
  --peach-light: rgba(245, 158, 11, 0.15);
  --gold: #F59E0B;
  --sidebar-w: 230px;
  --radius: 16px;
  --radius-sm: 8px;
  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  padding: 1.5rem 1rem;
}

.sidebar-header {
  margin-bottom: 2.5rem;
  padding: 0 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--lavender), var(--sage));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
  border-color: var(--border-active);
}

.nav-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
}

.settings-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-btn:hover {
  background: var(--accent-soft);
  border-color: var(--border-active);
  color: var(--text);
}

/* MAIN */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2.5rem;
  max-width: calc(100vw - var(--sidebar-w));
  min-height: 100vh;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--lavender), #4F46E5);
  color: white;
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(176, 158, 224, 0.3);
}

.btn-secondary {
  background: var(--accent-soft);
  border: 1px solid var(--border-active);
  color: var(--accent);
}

.btn-secondary:hover {
  background: rgba(176, 158, 224, 0.2);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--border-active);
  color: var(--text);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* CARDS */
.card {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-active);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 500;
}

.card-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* QUICK ACTIONS */
.section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.quick-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.quick-card:hover {
  border-color: var(--border-active);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.quick-card.featured {
  border-color: rgba(176, 158, 224, 0.2);
}

.qc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.qc-icon {
  font-size: 1.4rem;
  color: var(--accent);
}

.qc-badge {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border-active);
  font-weight: 500;
}

.qc-badge.new {
  background: rgba(127, 184, 154, 0.15);
  color: var(--sage);
  border-color: rgba(127, 184, 154, 0.3);
}

.qc-badge.glow {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse-glow 2s ease infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 8px var(--accent-glow);
  }

  50% {
    box-shadow: 0 0 16px var(--accent-glow);
  }
}

.quick-card h3 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.quick-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.qc-arrow {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  color: var(--text-subtle);
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.quick-card:hover .qc-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* TIPS */
.tips-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tip-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.tip-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--border-active);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tip-item strong {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.3rem;
}

.tip-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* STYLE TAB */
.style-grid-single {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 860px;
}

.count-badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
}

.big-textarea {
  width: 100%;
  min-height: 350px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.7;
  padding: 1rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.big-textarea:focus {
  outline: none;
  border-color: var(--border-active);
}

.big-textarea::placeholder {
  color: var(--text-subtle);
}

.textarea-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.style-profile-card {
  min-height: 280px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-subtle);
  transition: background 0.3s;
}

.status-dot.active {
  background: var(--sage);
  box-shadow: 0 0 8px rgba(127, 184, 154, 0.5);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.85rem;
  line-height: 1.6;
}

.style-traits {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.style-trait-item {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.style-trait-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.style-trait-value {
  font-size: 0.88rem;
  line-height: 1.5;
}

.style-params {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.param-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.param-select,
.param-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.param-select:focus,
.param-input:focus {
  outline: none;
  border-color: var(--border-active);
}

.param-select option {
  background: #1e1e28;
}

/* RESEARCH TAB */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
  border-color: var(--border-active);
}

.search-icon {
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.search-input:focus {
  outline: none;
}

.search-input::placeholder {
  color: var(--text-subtle);
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.cat-tab {
  padding: 0.45rem 1rem;
  border-radius: 20px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-tab:hover {
  border-color: var(--border-active);
  color: var(--text);
}

.cat-tab.active {
  background: var(--accent-soft);
  border-color: var(--border-active);
  color: var(--accent);
}

.ai-research-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.air-icon {
  font-size: 1.5rem;
  color: var(--gold);
  flex-shrink: 0;
}

.air-content {
  flex: 1;
  min-width: 150px;
}

.air-content h4 {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.air-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.air-input-group {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.air-input {
  padding: 0.5rem 0.8rem;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  width: 220px;
}

.air-input:focus {
  outline: none;
  border-color: var(--border-active);
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.topic-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.topic-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.topic-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.topic-emoji {
  font-size: 1.5rem;
}

.topic-cat {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
}

.topic-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.topic-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.topic-ideas {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.topic-ideas:empty {
  margin-bottom: 0;
}

.topic-idea {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topic-idea::before {
  content: '·';
  color: var(--accent);
  flex-shrink: 0;
}

.topic-use-btn {
  width: 100%;
  margin-top: auto;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.topic-use-btn:hover {
  background: var(--accent-soft);
  border-color: var(--border-active);
  color: var(--accent);
}

.ai-results {
  margin-top: 1.5rem;
}

.ai-idea-item {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.ai-idea-num {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.ai-idea-title {
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.ai-idea-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.ai-idea-use {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.6rem;
  padding: 0.3rem 0.7rem;
  background: var(--accent-soft);
  border: 1px solid var(--border-active);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-idea-use:hover {
  background: rgba(176, 158, 224, 0.25);
}

/* GENERATE TAB */
.generate-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.med-textarea {
  width: 100%;
  min-height: 120px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.7;
  padding: 0.85rem;
  resize: vertical;
  margin-top: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.med-textarea:focus {
  outline: none;
  border-color: var(--border-active);
}

.med-textarea::placeholder {
  color: var(--text-subtle);
}

.content-type-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ctype-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.5rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.ctype-btn:hover {
  border-color: var(--border-active);
}

.ctype-btn.active {
  background: var(--accent-soft);
  border-color: var(--border-active);
}

.ctype-btn.active .fb-label {
  color: var(--accent);
}

.slides-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.slides-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slides-btn:hover {
  border-color: var(--border-active);
  background: var(--accent-soft);
  color: var(--accent);
}

#slides-count-val {
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 1.5rem;
  text-align: center;
}

.format-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.format-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.5rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.format-btn:hover {
  border-color: var(--border-active);
}

.format-btn.active {
  background: var(--accent-soft);
  border-color: var(--border-active);
}

.fb-icon {
  font-size: 1.1rem;
}

.fb-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.format-btn.active .fb-label {
  color: var(--accent);
}

.extra-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.toggle-label>span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  transition: 0.3s;
}

.slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: 0.3s;
}

.toggle input:checked+.slider {
  background: var(--lavender);
}

.toggle input:checked+.slider::before {
  transform: translateX(16px);
  background: white;
}

.btn-generate {
  padding: 0.85rem;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--lavender), #4F46E5);
  color: white;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(176, 158, 224, 0.25);
}

.btn-generate:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(176, 158, 224, 0.4);
}

.gen-icon {
  font-size: 1.1rem;
}

.result-card {
  min-height: 400px;
}

.result-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.result-empty-icon {
  font-size: 3rem;
  opacity: 0.2;
  margin-bottom: 1rem;
}

.result-empty h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.result-empty p {
  font-size: 0.85rem;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.insta-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.insta-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lavender), var(--sage));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
}

.insta-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.insta-location {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.result-actions-top {
  display: flex;
  gap: 0.4rem;
}

.post-text {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  min-height: 100px;
}

.slide-block {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
}

.slide-num {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.slide-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}

.hashtags-block {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--lavender);
  line-height: 1.6;
}

.post-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.meta-tag {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.loading-state {
  text-align: center;
  padding: 5rem 2rem;
}

.correction-add-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.correction-add-row .param-input {
  flex: 1;
  margin: 0;
}

.correction-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
}

.correction-text {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.correction-delete {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 0.75rem;
  flex-shrink: 0;
  padding: 0.1rem 0.2rem;
  transition: color 0.2s;
}

.correction-delete:hover {
  color: var(--rose);
}

/* Feedback block */
.feedback-block {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: background 0.2s;
}

.feedback-header:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.feedback-toggle-icon {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

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

.feedback-body {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}

.feedback-textarea {
  width: 100%;
  min-height: 80px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  line-height: 1.6;
  padding: 0.6rem 0.75rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--border-active);
}

.feedback-textarea::placeholder {
  color: var(--text-subtle);
}

.loader-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

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

.loading-state p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.variant-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.7;
  white-space: pre-wrap;
  margin-bottom: 0.75rem;
}

.variant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.variant-num {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.variant-actions {
  display: flex;
  gap: 0.4rem;
}

/* SAVED TAB */
.empty-state-page {
  text-align: center;
  padding: 5rem 2rem;
}

.empty-icon-lg {
  font-size: 3rem;
  opacity: 0.2;
  margin-bottom: 1.25rem;
}

.empty-state-page h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.empty-state-page p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.saved-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.saved-card:hover {
  border-color: var(--border-active);
}

.saved-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.saved-card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.saved-card-delete {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 0.75rem;
  transition: color 0.2s;
}

.saved-card-delete:hover {
  color: var(--rose);
}

.saved-card-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

.saved-card-footer {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 440px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform 0.25s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-size: 1rem;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.2s;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-hint a {
  color: var(--accent);
  text-decoration: none;
}

.modal-hint a:hover {
  text-decoration: underline;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.success {
  border-color: rgba(127, 184, 154, 0.4);
}

.toast.error {
  border-color: rgba(224, 152, 152, 0.4);
}

/* KNOWLEDGE BASE */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.kb-item {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kb-item:hover {
  border-color: var(--border-active);
}

.kb-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.kb-item-info {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.kb-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kb-name {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
  word-break: break-all;
}

.kb-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kb-type {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
}

.kb-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem;
}

.kb-delete {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem;
  transition: color 0.2s;
  flex-shrink: 0;
}

.kb-delete:hover {
  color: var(--rose);
}