/* ==========================================================================
   MATERIAL DESIGN 3 (M3) DARK OLIVE THEME & WORKSPACE STYLES
   ========================================================================== */

:root {
  /* M3 Dark Olive Color Palette Tokens */
  --md-sys-color-bg: #12140e;
  --md-sys-color-surface: #1a1c15;
  --md-sys-color-surface-container: #21241b;
  --md-sys-color-surface-container-high: #2b2e23;
  --md-sys-color-surface-container-highest: #36392c;
  --md-sys-color-on-surface: #e2e3d9;
  --md-sys-color-on-surface-variant: #c4c8ba;
  --md-sys-color-primary: #9eb87e;
  --md-sys-color-on-primary: #1b3700;
  --md-sys-color-primary-container: #324e13;
  --md-sys-color-on-primary-container: #b9d497;
  --md-sys-color-secondary: #c2c8b6;
  --md-sys-color-secondary-container: #41483a;
  --md-sys-color-on-secondary-container: #dee4d2;
  --md-sys-color-outline: #44483c;
  --md-sys-color-outline-variant: #2d3126;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);

  /* Workspace Theme Mapping */
  --bg-dark: var(--md-sys-color-bg);
  --bg-sidebar: var(--md-sys-color-surface);
  --bg-card: var(--md-sys-color-surface-container);
  --border-color: var(--md-sys-color-outline);
  --text-main: var(--md-sys-color-on-surface);
  --text-muted: var(--md-sys-color-on-surface-variant);
  --primary-blue: var(--md-sys-color-primary);
  --primary-hover: #b5d392;
  --accent-amber: #e0c46b;
  --accent-green: #9eb87e;
  --accent-red: #ff897d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--md-sys-color-outline) var(--md-sys-color-surface-container);
}

/* Custom Scrollbars for Material Design 3 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--md-sys-color-surface-container);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline);
  border-radius: 4px;
  border: 2px solid var(--md-sys-color-surface-container);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--md-sys-color-primary);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

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

/* ==========================================================================
   TOP BAR & NAVIGATION
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--md-sys-color-surface-container);
  border-bottom: 2px solid var(--md-sys-color-outline-variant);
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

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

.brand-icon {
  font-size: 1.5rem;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--md-sys-color-primary);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--md-sys-color-primary);
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--md-sys-color-surface-container-high);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--text-main);
  background: var(--md-sys-color-surface-container-highest);
}

.nav-btn.active {
  color: var(--md-sys-color-on-primary);
  background: var(--md-sys-color-primary);
  border-color: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(158, 184, 126, 0.25);
}

.nav-btn.highlight {
  border: 1px solid var(--accent-amber);
  color: var(--accent-amber);
}

.nav-btn.highlight.active {
  background: var(--accent-amber);
  color: #1a1c15;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.manager-name {
  font-weight: 600;
  color: var(--text-main);
}

.btn-logout {
  background: var(--md-sys-color-surface-container-high);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border-color: var(--md-sys-color-error);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

/* ==========================================================================
   MAIN CONTENT & TAB PAGES
   ========================================================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.tab-page {
  display: none !important;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.tab-page.active {
  display: flex !important;
  flex-direction: column;
}

#tab-chats.tab-page.active {
  display: flex !important;
  flex-direction: row;
}

.workspace-layout {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--md-sys-color-bg);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   BLOCK 1: LEFT SIDEBAR (LEADS LIST)
   -------------------------------------------------------------------------- */

.leads-sidebar {
  width: 330px;
  min-width: 330px;
  height: 100%;
  min-height: 0;
  background: var(--md-sys-color-surface);
  border-right: 2px solid var(--md-sys-color-outline-variant);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.sidebar-header {
  padding: 1rem 1.2rem;
  border-bottom: 2px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
  flex-shrink: 0;
}

.sidebar-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-search {
  width: 100%;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline);
  color: var(--text-main);
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-search:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px rgba(158, 184, 126, 0.2);
}

.leads-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.lead-item {
  margin-bottom: 0.4rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lead-item:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-outline);
  transform: translateX(2px);
}

.lead-item.active {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-primary);
  border-left: 5px solid var(--md-sys-color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lead-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.lead-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.lead-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Status Pills */
.status-pill {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.status-pill.NEW { background: #2563eb; color: #ffffff; }
.status-pill.QUALIFIED { background: #aacc7d; color: #1b3700; }
.status-pill.MANAGER_REQUIRED { background: #ef4444; color: #ffffff; }
.status-pill.IN_PROGRESS { background: #e0c46b; color: #1c1d18; }
.status-pill.WON { background: #10b981; color: #ffffff; }
.status-pill.LOST { background: #64748b; color: #ffffff; }

/* --------------------------------------------------------------------------
   BLOCK 2: CENTER CHAT WINDOW & FUNNEL SELECTOR
   -------------------------------------------------------------------------- */

.chat-container {
  flex: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-bg);
  border-right: 2px solid var(--md-sys-color-outline-variant);
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.4rem;
  background: var(--md-sys-color-surface-container);
  border-bottom: 2px solid var(--md-sys-color-outline-variant);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.chat-header.hidden { display: none; }

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.chat-user-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.phone-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  background: var(--md-sys-color-surface-container-high);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--md-sys-color-outline-variant);
}

/* Funnel Status Dropdown Selector */
.funnel-status-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--md-sys-color-surface-container-high);
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--md-sys-color-outline);
}

.funnel-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.funnel-status-select {
  background: var(--md-sys-color-surface);
  color: var(--text-main);
  border: 1px solid var(--md-sys-color-primary);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.funnel-status-select:focus {
  box-shadow: 0 0 0 2px rgba(158, 184, 126, 0.3);
}

.chat-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  background: var(--md-sys-color-surface-container-high);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--md-sys-color-outline);
}

.toggle-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Messages Area */
.messages-area {
  flex: 1;
  min-height: 0;
  padding: 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: radial-gradient(circle at center, rgba(33, 36, 27, 0.5) 0%, var(--md-sys-color-bg) 100%);
}

.empty-state {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
  max-width: 360px;
}

.empty-icon { font-size: 3.5rem; margin-bottom: 0.75rem; }

.msg-bubble {
  max-width: 72%;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.msg-bubble.inbound {
  align-self: flex-start;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface);
  border-bottom-left-radius: 4px;
}

.msg-bubble.outbound {
  align-self: flex-end;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border: 1px solid rgba(158, 184, 126, 0.35);
  border-bottom-right-radius: 4px;
}

.msg-sender {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  margin-bottom: 0.25rem;
  letter-spacing: 0.3px;
}

.msg-bubble.outbound .msg-sender {
  color: var(--md-sys-color-on-primary-container);
  opacity: 0.9;
}

.msg-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.4rem;
}

.msg-media a {
  color: var(--md-sys-color-primary);
  text-decoration: underline;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Chat Input Bar */
.chat-input-bar {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1.4rem;
  background: var(--md-sys-color-surface-container);
  border-top: 2px solid var(--md-sys-color-outline-variant);
  flex-shrink: 0;
}

.chat-input-bar.hidden { display: none; }

.chat-input-bar input {
  flex: 1;
  background: var(--md-sys-color-bg);
  border: 1px solid var(--md-sys-color-outline);
  color: var(--text-main);
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
}

.chat-input-bar input:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px rgba(158, 184, 126, 0.25);
}

/* --------------------------------------------------------------------------
   BLOCK 3: RIGHT SIDEBAR (AI SUMMARY & FOLLOW-UPS & MEMORY)
   -------------------------------------------------------------------------- */

.memory-sidebar {
  width: 340px;
  min-width: 340px;
  height: 100%;
  min-height: 0;
  background: var(--md-sys-color-surface);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-section h4 {
  font-size: 0.82rem;
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.section-title-row h4 { margin-bottom: 0 !important; }

.summary-card, .memory-card {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 10px;
  padding: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-main);
}

.followup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.83rem;
}

.followup-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.followup-due {
  font-size: 0.72rem;
  color: var(--accent-amber);
  font-weight: 600;
}

.fact-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.fact-row:last-child { border-bottom: none; }
.fact-key { color: var(--text-muted); font-weight: 500; }
.fact-val { font-weight: 600; color: var(--text-main); }

/* ==========================================================================
   TAB 2: KANBAN BOARD
   ========================================================================== */

.kanban-header {
  padding: 1.2rem 1.6rem;
  background: var(--md-sys-color-surface-container);
  border-bottom: 2px solid var(--md-sys-color-outline-variant);
}

.kanban-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

.kanban-board {
  flex: 1;
  display: flex;
  gap: 1.2rem;
  padding: 1.2rem 1.6rem;
  overflow-x: auto;
  background: var(--md-sys-color-bg);
}

.kanban-col {
  width: 290px;
  min-width: 280px;
  background: var(--md-sys-color-surface);
  border: 2px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.col-title {
  padding: 0.85rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--md-sys-color-surface-container);
  border-bottom: 2px solid var(--md-sys-color-outline-variant);
  display: flex;
  justify-content: space-between;
  color: var(--text-main);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.col-cards {
  flex: 1;
  padding: 0.85rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.kanban-card {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 10px;
  padding: 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.kanban-card:hover {
  border-color: var(--md-sys-color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   MODAL DIALOGS (LOGIN & FOLLOW-UP)
   ========================================================================== */

.login-overlay, .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 20, 14, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-overlay.hidden, .modal-overlay.hidden { display: none; }

.login-card, .modal-card {
  width: 100%;
  max-width: 450px;
  background: var(--md-sys-color-surface-container-high);
  border: 2px solid var(--md-sys-color-outline);
  border-radius: 16px;
  padding: 2.2rem;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  padding-bottom: 0.75rem;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.preset-time-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.2rem;
}

.preset-label {
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.btn-preset-time {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  color: var(--text-main);
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset-time:hover {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
}

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

/* ==========================================================================
   BUTTONS & FORM CONTROLS
   ========================================================================== */

.btn-primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(158, 184, 126, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(158, 184, 126, 0.35);
}

.btn-secondary {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: 1px solid var(--md-sys-color-outline);
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-primary);
}

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

.btn-large {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
}

.btn-close-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.btn-close-sm:hover { color: var(--text-main); }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input, .form-textarea {
  background: var(--md-sys-color-bg);
  border: 1px solid var(--md-sys-color-outline);
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px rgba(158, 184, 126, 0.25);
}

/* ==========================================================================
   SIMULATOR & PACKAGES STYLES
   ========================================================================== */

.simulator-container, .packages-container {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background: var(--md-sys-color-bg);
}

.simulator-card {
  max-width: 750px;
  margin: 0 auto;
  background: var(--md-sys-color-surface-container);
  border: 2px solid var(--md-sys-color-outline);
  border-radius: 16px;
  padding: 2.2rem;
  box-shadow: var(--shadow);
}

.subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.preset-scenarios { margin: 1rem 0; }

.preset-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-preset {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline);
  color: var(--text-main);
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.15s ease;
}

.btn-preset:hover {
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.divider {
  border: 0;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  margin: 1.5rem 0;
}

.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.pkg-card {
  background: var(--md-sys-color-surface-container);
  border: 2px solid var(--md-sys-color-outline);
  border-radius: 12px;
  padding: 1.2rem;
}

.pkg-card h3 {
  font-size: 1.05rem;
  color: var(--md-sys-color-primary);
  margin-bottom: 0.75rem;
}

.pkg-card textarea { width: 100%; margin: 0.5rem 0; }

/* Translator widget styling */
.translator-widget {
  background: var(--md-sys-color-surface-container-high);
  border-top: 2px solid var(--md-sys-color-primary);
  border-bottom: 2px solid var(--md-sys-color-outline);
  padding: 0.85rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.translator-widget.hidden { display: none; }

.translator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.translator-body { display: flex; gap: 0.6rem; }
