/* ═══════════════════════════════════════════════════════════
   LEARN.CSS — Learn Content Manager
   ═══════════════════════════════════════════════════════════ */

/* ── Admin: overall layout ─────────────────────────────────── */
.learn-admin-wrap {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

/* ── Admin: sidebar ─────────────────────────────────────────── */
.learn-admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  gap: 3px;
  overflow-y: auto;
}

.learn-sidebar-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 0 8px 10px;
}

.learn-sidebar-sep {
  height: 1px;
  background: var(--border);
  margin: 8px 4px;
}

.learn-nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text2);
  font-family: inherit;
  font-size: .86rem;
  font-weight: 500;
  padding: 9px 11px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background .12s, color .12s, border-color .12s;
}
.learn-nav-btn:hover {
  background: rgba(139,92,246,.1);
  border-color: rgba(139,92,246,.15);
  color: var(--text);
}
.learn-nav-btn.active {
  background: rgba(139,92,246,.18);
  border-color: rgba(139,92,246,.3);
  color: var(--accent2);
  font-weight: 600;
}
.learn-nav-icon { font-size: .95rem; flex-shrink: 0; }

/* ── Admin: editor panel ─────────────────────────────────────── */
.learn-admin-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.learn-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.learn-panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Rich text toolbar ───────────────────────────────────────── */
.learn-rte-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.learn-tb-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  font-family: inherit;
  font-size: .78rem;
  font-weight: 500;
  padding: 4px 9px;
  cursor: pointer;
  transition: background .12s, color .12s;
  line-height: 1.4;
}
.learn-tb-btn:hover { background: rgba(139,92,246,.15); color: var(--accent2); border-color: rgba(139,92,246,.3); }
.learn-tb-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

/* Color picker button */
.learn-color-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.learn-color-a-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 3px 8px 4px;
  line-height: 1.2;
}
.learn-color-bar {
  display: block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  transition: background .12s;
}

/* Color swatch dropdown */
.learn-color-swatches {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 500;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 164px;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.learn-color-swatch {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .1s, border-color .1s;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.learn-color-swatch:hover {
  transform: scale(1.2);
  border-color: rgba(255,255,255,.5);
}

/* ── Rich text body ──────────────────────────────────────────── */
.learn-rte-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.75;
  outline: none;
  min-height: 0;
}
.learn-rte-body h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--accent2);
  margin: 20px 0 8px;
  letter-spacing: .02em;
}
.learn-rte-body h3:first-child { margin-top: 0; }
.learn-rte-body ul, .learn-rte-body ol {
  padding-left: 1.4em;
  margin: 4px 0 10px;
}
.learn-rte-body li { margin: 4px 0; color: var(--text2); }
.learn-rte-body li strong { color: var(--text); }
.learn-rte-body p { margin: 6px 0; }

.learn-save-row {
  padding: 8px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 36px;
}
.learn-dirty-hint {
  font-size: .75rem;
  color: #f59e0b;
}

/* ════════════════════════════════════════════════════════════
   PLANT LIBRARY — Admin Editor
   ════════════════════════════════════════════════════════════ */
.learn-plant-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Horizontal scrollable strip of plant cards */
.learn-plant-strip {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  overflow-y: auto;
}

.learn-plant-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 7px 9px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.learn-plant-card:hover { background: rgba(139,92,246,.09); border-color: rgba(139,92,246,.15); }
.learn-plant-card.active { background: rgba(139,92,246,.18); border-color: rgba(139,92,246,.3); }

.learn-plant-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.learn-plant-thumb-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.learn-plant-card-name {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Plant detail editor panel */
.learn-plant-detail {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  min-height: 0;
}
.learn-plant-editor-empty {
  color: var(--text2);
  font-size: .88rem;
  padding: 32px;
  text-align: center;
}

/* Plant detail editor internals */
.learn-pde-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.learn-pde-name-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 12px;
}
.learn-pde-name-input:focus { outline: none; border-color: var(--accent2); }
.learn-pde-delete-btn {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 8px;
  color: #f87171;
  font-size: .85rem;
  padding: 7px 10px;
  cursor: pointer;
  transition: background .12s;
}
.learn-pde-delete-btn:hover { background: rgba(239,68,68,.2); }

.learn-pde-image-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.learn-pde-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  flex-shrink: 0;
}
.learn-pde-img-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  color: var(--text2);
}
.learn-pde-upload-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}
.learn-pde-upload-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.learn-pde-upload-hint {
  font-size: .75rem;
  color: var(--text2);
}
.learn-pde-care-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
}
.learn-pde-care-body {
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg3);
  padding: 12px 14px;
}

/* ════════════════════════════════════════════════════════════
   PORTAL READ-ONLY MODAL
   ════════════════════════════════════════════════════════════ */
.learn-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 2000;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility 0s linear .22s;
}
.learn-modal-overlay.open {
  opacity: 1;
  visibility: visible;
  transition: opacity .22s ease;
}

.learn-modal {
  width: min(680px, 100vw);
  height: 100%;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(32px);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  box-shadow: -12px 0 48px rgba(0,0,0,.5);
}
.learn-modal-overlay.open .learn-modal {
  transform: translateX(0);
}

.learn-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg3);
}
.learn-modal-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.learn-modal-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.learn-modal-close:hover { background: rgba(255,255,255,.08); color: var(--text); }

/* Modal tabs */
.learn-modal-tabs {
  display: flex;
  gap: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg2);
}
.learn-modal-tabs::-webkit-scrollbar { display: none; }
.learn-modal-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 500;
  padding: 12px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
}
.learn-modal-tab:hover { color: var(--text); }
.learn-modal-tab.active {
  color: var(--accent2);
  border-bottom-color: var(--accent2);
  font-weight: 600;
}

/* Modal body */
.learn-modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Section content in portal */
.learn-portal-section { padding: 28px 28px 40px; }
.learn-portal-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px;
}
.learn-portal-content { color: var(--text); font-size: .9rem; line-height: 1.8; }
.learn-portal-content h3 {
  font-size: .92rem;
  font-weight: 700;
  color: var(--accent2);
  margin: 22px 0 8px;
  letter-spacing: .02em;
}
.learn-portal-content h3:first-child { margin-top: 0; }
.learn-portal-content ul, .learn-portal-content ol {
  padding-left: 1.4em;
  margin: 4px 0 12px;
}
.learn-portal-content li { margin: 5px 0; color: var(--text2); }
.learn-portal-content li strong { color: var(--text); }
.learn-portal-content p { margin: 6px 0 10px; color: var(--text2); }
.learn-portal-content strong { color: var(--text); }

/* ── Portal plant library ─────────────────────────────────── */
.learn-plants-portal-wrap {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.learn-plants-left {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.learn-plant-portal-search-wrap {
  padding: 12px 10px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.learn-plant-search-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: .83rem;
  padding: 7px 10px;
  box-sizing: border-box;
}
.learn-plant-search-input:focus { outline: none; border-color: var(--accent2); }

.learn-portal-plant-grid {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 6px;
}

.learn-portal-plant-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.learn-portal-plant-card:hover { background: rgba(139,92,246,.09); border-color: rgba(139,92,246,.15); }
.learn-portal-plant-card.active { background: rgba(139,92,246,.18); border-color: rgba(139,92,246,.3); }

.learn-portal-plant-img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 7px;
  flex-shrink: 0;
}
.learn-portal-plant-img-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.learn-portal-plant-name {
  font-size: .83rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.learn-plants-right {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.learn-plant-portal-hint {
  color: var(--text2);
  font-size: .85rem;
  padding: 32px;
  text-align: center;
}
.learn-portal-plant-detail-wrap { padding: 24px; }
.learn-portal-plant-detail-img {
  width: 100%;
  max-width: 340px;
  height: 220px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 16px;
  cursor: zoom-in;
  display: block;
}
.learn-portal-plant-detail-img-placeholder {
  width: 100%;
  max-width: 340px;
  height: 220px;
  border-radius: 14px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--text2);
}
.learn-portal-plant-detail-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px;
}
.learn-portal-care-notes {
  font-size: .88rem;
  line-height: 1.75;
  color: var(--text2);
}
.learn-portal-care-notes h3 {
  font-size: .88rem;
  font-weight: 700;
  color: var(--accent2);
  margin: 16px 0 6px;
}
.learn-portal-care-notes ul, .learn-portal-care-notes ol {
  padding-left: 1.3em;
  margin: 4px 0 8px;
}
.learn-portal-care-notes li { margin: 4px 0; }
.learn-portal-care-notes strong { color: var(--text); }

/* ── Portal "Learn" button ────────────────────────────────── */
.portal-learn-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.28);
  border-radius: 8px;
  color: var(--accent2);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  padding: 6px 13px;
  cursor: pointer;
  transition: background .14s, border-color .14s;
  white-space: nowrap;
}
.portal-learn-btn:hover {
  background: rgba(139,92,246,.22);
  border-color: rgba(139,92,246,.45);
}

/* ── Admin view container ─────────────────────────────────── */
#view-learn.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

/* ════════════════════════════════════════════════════════════
   MOBILE LEARN — card list + slide-in detail view
   ════════════════════════════════════════════════════════════ */

/* List container */
.learn-mobile-list {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
}

.learn-mobile-list-header {
  padding: 28px 20px 14px;
}
.learn-mobile-list-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: -.02em;
}
.learn-mobile-list-sub {
  font-size: .8rem;
  color: var(--text2);
  margin: 0;
}

.learn-mobile-sections {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 16px 32px;
}

/* Section card rows */
.learn-mobile-sec-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--bg2);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  padding: 16px 14px;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.learn-mobile-sec-card:first-child { border-radius: 14px 14px 0 0; }
.learn-mobile-sec-card:last-child  { border-radius: 0 0 14px 14px; border-bottom: none; }
.learn-mobile-sec-card:only-child  { border-radius: 14px; }
.learn-mobile-sec-card:active      { background: rgba(139,92,246,.12); }

.learn-mobile-sec-icon  { font-size: 1.2rem; flex-shrink: 0; width: 28px; text-align: center; }
.learn-mobile-sec-title { flex: 1; }
.learn-mobile-sec-arrow {
  font-size: 1.3rem;
  color: var(--text2);
  font-weight: 300;
  line-height: 1;
}

/* ── Full-screen thread panel (list → detail) ───────────────── */
.learn-mobile-thread {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overscroll-behavior: contain;
}
.learn-mobile-thread.open {
  transform: translateX(0);
}

/* Floating transparent header — bubbles float over scrolling content */
.learn-mobile-thread-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: max(env(safe-area-inset-top, 0px), 10px);
  padding-left: 12px;
  padding-right: 12px;
  padding-bottom: 8px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  pointer-events: none; /* let through to scroll; buttons re-enable below */
}
.learn-mobile-thread-header > * { pointer-events: auto; }

/* Back button — frosted circle (same as chat-back-btn) */
.learn-mobile-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(20, 18, 38, 0.38);
  backdrop-filter: blur(32px) saturate(180%) brightness(1.1);
  -webkit-backdrop-filter: blur(32px) saturate(180%) brightness(1.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 16px rgba(0,0,0,0.20);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}
.learn-mobile-back-label { display: none; } /* hidden — arrow only */

/* Title — frosted pill (same as chat-hdr-name) */
.learn-mobile-thread-title {
  background: rgba(20, 18, 38, 0.38);
  backdrop-filter: blur(32px) saturate(180%) brightness(1.1);
  -webkit-backdrop-filter: blur(32px) saturate(180%) brightness(1.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 16px rgba(0,0,0,0.20);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  text-align: center;
  flex: unset;
}

.learn-mobile-header-spacer {
  width: 40px; /* mirrors back button so pill stays centred */
  flex-shrink: 0;
}

/* Scrollable body — top padding clears the floating header */
.learn-mobile-thread-body {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 78px 20px 40px; /* 78px clears tightened header + safe area */
  overscroll-behavior: contain;
}

/* Rich content styles (matches portal content) */
.learn-mobile-content-body {
  font-size: .92rem;
  line-height: 1.8;
  color: var(--text);
}
.learn-mobile-content-body h3 {
  font-size: .92rem;
  font-weight: 700;
  color: var(--accent2);
  margin: 22px 0 8px;
  letter-spacing: .02em;
}
.learn-mobile-content-body h3:first-child { margin-top: 0; }
.learn-mobile-content-body ul,
.learn-mobile-content-body ol { padding-left: 1.4em; margin: 4px 0 12px; }
.learn-mobile-content-body li { margin: 5px 0; color: var(--text2); }
.learn-mobile-content-body li strong { color: var(--text); }
.learn-mobile-content-body p { margin: 6px 0 10px; color: var(--text2); }
.learn-mobile-content-body strong { color: var(--text); }

.learn-mobile-empty {
  color: var(--text2);
  font-size: .88rem;
  text-align: center;
  padding: 40px 20px;
}

/* ── Plant library grid ──────────────────────────────────────── */
.learn-mobile-plant-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.learn-mobile-plant-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px 12px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: background .12s, border-color .12s;
}
.learn-mobile-plant-card:active {
  background: rgba(139,92,246,.12);
  border-color: rgba(139,92,246,.3);
}

.learn-mobile-plant-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}
.learn-mobile-plant-img-ph {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.learn-mobile-plant-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

/* Plant detail full-page (second-level) */
.learn-mobile-plant-detail-img {
  width: 100%;
  border-radius: 14px;
  object-fit: cover;
  max-height: 440px;
  display: block;
  margin-bottom: 20px;
  cursor: zoom-in;
}
.learn-mobile-plant-detail-ph {
  width: 100%;
  height: 200px;
  border-radius: 14px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  margin-bottom: 20px;
}

/* ── Plant Library search ──────────────────────────────────── */

/* Search icon — frosted circle (mirrors chat-hdr-actions) */
.learn-mobile-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(20, 18, 38, 0.38);
  backdrop-filter: blur(32px) saturate(180%) brightness(1.1);
  -webkit-backdrop-filter: blur(32px) saturate(180%) brightness(1.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 16px rgba(0,0,0,0.20);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1rem;
  font-family: inherit;
}

/* Search input — hidden by default, expands when search-active */
.lpl-search-input {
  display: none;
  flex: 1;
  min-width: 0;
  background: rgba(20, 18, 38, 0.52);
  backdrop-filter: blur(32px) saturate(180%) brightness(1.1);
  -webkit-backdrop-filter: blur(32px) saturate(180%) brightness(1.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--text);
  font-family: inherit;
  font-size: .88rem;
  padding: 8px 16px;
  outline: none;
  box-shadow: 0 2px 16px rgba(0,0,0,0.20);
}
.lpl-search-input::placeholder { color: rgba(255,255,255,.4); }

/* Red ✕ close — hidden by default */
.lpl-search-close {
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(248, 113, 113, 0.22);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(248, 113, 113, 0.38);
  box-shadow: 0 2px 16px rgba(0,0,0,0.20);
  color: #f87171;
  cursor: pointer;
  flex-shrink: 0;
  font-size: .9rem;
  font-family: inherit;
}

/* search-active: title & search icon hide, input & close appear */
.learn-mobile-thread-header.search-active #lpl-title       { display: none; }
.learn-mobile-thread-header.search-active .learn-mobile-search-btn { display: none; }
.learn-mobile-thread-header.search-active .lpl-search-input { display: flex; }
.learn-mobile-thread-header.search-active .lpl-search-close { display: inline-flex; }
