/* My Apothecary overrides (CSP-safe, no inline styles required) */

/* --- NAV --- */
.apoth-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 16px 16px;
}
.apoth-nav .hub-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

/* --- MAIN LAYOUT --- */
/* Apothecary Hub overrides */
.apoth-main { width: 100%; }               /* optional: use full width */

#leftColumn { flex: 0 1 90%; }             /* 70/30 split */
.apoth-rail { flex: 0 1 10%; 
              border-left: 0;              /* remove divider */
              padding-left: 0; }           /* tighten once divider is gone */


/* --- RIGHT RAIL CONTENT --- */
.apoth-preview { margin-bottom: 20px; }
.apoth-preview .apoth-thumb-btn {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: block;
  margin-bottom: 8px;
}
.apoth-preview .apoth-thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  display: block;
}
.apoth-preview .apoth-empty {
  padding: 8px;
  color: var(--color-muted);
  font-size: 13px;
  border: 1px dashed var(--color-accent);
  border-radius: 8px;
  margin-bottom: 8px;
}
.apoth-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}
.apoth-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 120px;
}
.apoth-item .apoth-card {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  display: block;
}
.apoth-item .apoth-label {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  max-width: 120px;
}

/* Shared hub button hover in the rail */
.apoth-buttons .hub-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* --- FORM + CARD UTILITIES (used by Herb Profile + Recipe Card) --- */
.apoth-section {
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 12px 0;
}
.apoth-section h3 { margin: 0 0 10px 0; }

.apoth-field,
.apoth-field input[type="text"],
.apoth-field input[type="number"],
.apoth-field textarea,
.apoth-field select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  box-sizing: border-box;
}

.apoth-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.apoth-row > * { flex: 1 1 220px; }

.apoth-hint { font-size: 12px; color: var(--color-muted); }

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px 0;
  flex-wrap: wrap;
}

/* Sticky mini tabs */
.apoth-tabs {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  padding: 8px;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  margin: 0 0 12px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.apoth-tab {
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  text-transform: uppercase;
  color: inherit;
}

/* Recipe Card container */
.rc-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--color-accent);
  border-radius: 12px;
  box-sizing: border-box;
}
.rc-row { display: flex; gap: 10px; flex-wrap: wrap; }
.rc-row > * { flex: 1 1 220px; }
.rc-hint { font-size: 12px; color: var(--color-muted); }
.rc-title { margin: 0 0 10px 0; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  opacity: 0;
  transform: translateY(8px);
  transition: all .25s;
  background: #0a7;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,.15);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Visibility helper (avoid style="display:none") */
.is-hidden { display: none !important; }

/* Phone tweaks */
@media (max-width: 900px) {
  .rc-wrap { padding: 12px; }
}
@media (max-width: 600px) {
  .apoth-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-left: 0;
  }
  .apoth-nav .hub-btn { width: 100%; justify-content: center; }
}
/* Right-rail hub button base (CSP-safe) */
.apoth-buttons .hub-btn {
  padding: 6px 10px;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  background: #fff;
  min-width: 140px;
  text-align: center;
  box-sizing: border-box;
}
/* Right rail layout (replaces container.style = ...) */
#apothecaryButtons.apoth-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

/* Rail buttons (replaces ensureRightRailStyles + btn.style.*) */
.apoth-buttons .hub-btn,
.apoth-buttons .recipe-btn,
.apoth-buttons button {
  padding: 6px 10px;
  border: 1px solid #B08A48;
  border-radius: 8px;
  background: #fff;
  min-width: 140px;
  text-align: center;
  box-sizing: border-box;
}
.apoth-buttons .hub-btn:hover,
.apoth-buttons .recipe-btn:hover,
.apoth-buttons button:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Chat scroll area (replaces inline style) */
.chat-scroll { max-height: 360px; overflow: auto; }

/* Chat message title spacing (replaces inline margin) */
.rc-title--msg { margin: 0 0 4px 0; }

/* CSP-safe iframe + link styles (used by the kept embed) */
.doc-frame { width: 100%; height: 600px; border: 1px solid #b08a48; border-radius: 8px; }
.doc-open-link { display: inline-block; margin-top: 8px; text-decoration: underline; }

/* Error text (used in recipes error) */
.apoth-error { color: #b00020; }

/* ===========================
   APOTHECARY UNIFORM OVERRIDES
   Place LAST in the CSS load order
   =========================== */

/* 1) Force 70/30 columns across all tabs */
@media (min-width: 768px) {
  #mainContainer {
    display: grid !important;
    grid-template-columns: 7fr 3fr !important;  /* 70/30 */
    align-items: stretch;
    gap: 2rem;                                   /* keep your existing spacing */
  }
}
@media (min-width: 1024px) {
  #mainContainer {
    grid-template-columns: 7fr 3fr !important;   /* keep 70/30 on desktop */
  }
}

/* 2) Left column FLUSH (remove any left gutter/inset) */
#leftColumn { 
  padding-left: 0 !important; 
  margin-left: 0 !important;
}

/* 3) Right rail: no divider, no extra inset (gap handles spacing) */
#rightColumn { 
  padding-left: 0 !important; 
}
.apoth-rail { 
  border-left: 0 !important; 
  padding-left: 0 !important; 
}

/* 4) Recipe card: full-width in the left column (no centered/narrow card) */
.rc-wrap {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;        /* remove auto-centering inset */
}

/* 5) Safety net for legacy flex container width */
.apoth-main { 
  width: 100% !important; 
}

