/* ==================
   LEGACY DETAIL NAV (prev/next/back)
   ================== */

.detail-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; position: relative; }

/* Centered screen-name label in any topbar */
.screen-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #aaa;
  pointer-events: none;
  white-space: nowrap;
}
.detail-nav    { display: flex; align-items: center; gap: 0.5rem; }
.nav-counter   { font-size: 12px; color: #888; min-width: 3rem; text-align: center; }

.nav-btn {
  display: inline-block;
  color: #7c5cbf;
  text-decoration: none;
  font-size: var(--font-size-sm);
  padding: 0.2rem 0.6rem;
  border: 1px solid #c4b0e8;
  border-radius: 4px;
}

.nav-btn:hover      { background: #f3eeff; text-decoration: none; }
.nav-btn--disabled  { color: #bbb; border-color: #e0e0e0; cursor: default; }

/* ==================
   LEGACY COLLAPSIBLE DETAIL PANELS
   ================== */

.detail-panels       { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.detail-panels-left  { flex: 0 0 520px; min-width: 0; }
.detail-panels-right { flex: 1; min-width: 220px; }

.detail-panel {
  border: 1px solid #e5e5e0;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.detail-panel > summary {
  list-style: none;
  padding: 0.5rem 0.875rem;
  background: #f5f5f0;
  border-radius: 6px 6px 0 0;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.detail-panel > summary::-webkit-details-marker { display: none; }
.detail-panel > summary::after                  { content: "▾"; font-size: 14px; }
.detail-panel > summary:hover                   { background: #eeede8; }
.detail-panel[open] > summary::after            { content: "▴"; }

.detail-panel-body { padding: 0.75rem 0.875rem; }

.detail-list         { margin: 0 0 0.5rem; padding-left: 1.2rem; font-size: var(--font-size-sm); }
.detail-list li      { margin-bottom: 0.35rem; }
.detail-list-meta    { margin-left: 1rem; }
.detail-list-markers { margin-left: 0.75rem; }

.detail-footer {
  font-size: 11px;
  color: #aaa;
  padding: 8px 12px 80px; /* 80px clears mobile bottom nav */
}

/* ==================
   LEGACY DETAIL LAYOUT + TABLE
   ================== */

.detail-layout { display: flex; gap: 1.5rem; align-items: flex-start; }

/* ==================
   DETAIL HEADER (Bootstrap card redesign)
   ================== */

/* Sticky detail header — z-index 99, one below navbar (100); sticks at top:48px */
.detail-header {
  position: sticky;
  top: 48px;
  z-index: 99;
  background: #fff;
  border-bottom: 0.5px solid rgba(0,0,0,0.10);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 12px;
  margin-bottom: 8px;
}

.detail-header-left  { min-width: 0; flex: 1; }
.detail-header-right { flex-shrink: 0; }

.detail-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-seedkey    { font-size: 18px; font-weight: 600; color: var(--cat-green); font-family: var(--font-mono); }
.detail-name       { font-size: 16px; font-weight: 500; color: var(--cat-text); }
.detail-gen-badge  { font-size: 11px; }
.detail-grown-check { color: var(--cat-green); font-size: 14px; }

/* Prev/next button group — Bootstrap --bs-btn-* overrides scoped to this component only */
.detail-header-right .btn-outline-success {
  --bs-btn-color:              #2D6A4F;
  --bs-btn-border-color:       #2D6A4F;
  --bs-btn-hover-color:        #fff;
  --bs-btn-hover-bg:           #2D6A4F;
  --bs-btn-hover-border-color: #2D6A4F;
  --bs-btn-active-color:       #fff;
  --bs-btn-active-bg:          #2D6A4F;
  --bs-btn-font-size:          12px;
}

/* ==================
   PANELS GRID
   ================== */

.panels-grid {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 0 0 8px;
}

@media (max-width: 767.98px) {
  .panels-grid { flex-direction: column; padding: 8px; }
  .panels-right { order: -1; }
}

.panels-left  { flex: 0 0 380px; min-width: 0; }
.panels-right { flex: 1; min-width: 0; max-width: 780px; }

/* Card overrides — scoped to panels-grid, no global Bootstrap card bleed */
.panels-grid .card {
  border: 0.5px solid rgba(0,0,0,0.10);
  border-radius: 8px;
  overflow: hidden;
}

.panels-grid .card-header {
  background: #f8f9fa;
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
  padding: 3px 10px;
}

/* Chevron rotates when panel is collapsed */
.panels-grid .panel-chevron                                                        { transition: transform 0.2s ease; }
.panels-grid [data-bs-toggle="collapse"][aria-expanded="false"] .panel-chevron    { transform: rotate(180deg); }

/* Always show collapse chevrons in card headers */
.panels-grid .card-header .icon-btn { opacity: 1; }

/* Table overrides — scoped to panels-grid cards */
.panels-grid .table                       { font-size: 12px; }
.panels-grid .table th {
  font-size: 11px;
  color: var(--cat-muted);
  font-weight: 500;
  border-bottom: 0.5px solid rgba(0,0,0,0.10);
  padding: 5px 8px;
  background: transparent;
}
.panels-grid .table td {
  padding: 5px 8px;
  border-bottom: 0.5px solid rgba(0,0,0,0.05);
  vertical-align: middle;
}
.panels-grid .table tbody tr:last-child td { border-bottom: none; }
.panels-grid .table a                      { color: var(--cat-green); text-decoration: none; font-weight: 500; }
.panels-grid .table a:hover                { text-decoration: underline; }

/* ==================
   PANEL TITLES + SUBTITLES
   ================== */

.panel-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--cat-muted);
  text-transform: uppercase;
}

.panel-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 0 4px;
}

/* ==================
   FIELD ROWS
   ================== */

.field-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px;
  padding: 5px 12px;
  border-bottom: 0.5px solid rgba(0,0,0,0.05);
  align-items: start;
  font-size: 13px;
}

.field-row:last-child { border-bottom: none; }

.field-label { color: var(--cat-muted); font-size: 12px; padding-top: 1px; }

.field-value             { color: var(--cat-text); word-break: break-word; }
.field-value.mono        { font-family: var(--font-mono); font-size: 12px; color: var(--cat-green); }
.field-value.muted       { color: #ccc; }
.field-value a           { color: var(--cat-green); text-decoration: none; font-weight: 500; }
.field-value a:hover     { text-decoration: underline; }

.field-value-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.field-value-wrap .field-value { flex: 1; min-width: 0; }

.field-value-wrap [data-inline-edit-target="form"] {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 100%;
  flex-wrap: wrap;
}

/* ==================
   ICON BUTTON (pencil visible on row hover)
   ================== */

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cat-muted);
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.1s, color 0.15s, background 0.15s;
  flex-shrink: 0;
  line-height: 1;
}

.icon-btn:hover          { color: var(--cat-green); background: #E1F5EE; opacity: 1; }
.field-row:hover .icon-btn { opacity: 1; }

/* Always show on touch devices */
@media (max-width: 767.98px) { .icon-btn { opacity: 1 !important; } }

/* ==================
   GENERIC CARD + CARD TABLE
   ================== */

.card { background: #fff; border: 1px solid #e0e0da; border-radius: 8px; padding: 10px; }
.card .table                     { width: 100%; border-collapse: collapse; }
.card .table th                  { text-align: left; padding: 0.5rem 1rem 0.5rem 0; color: #666; font-weight: 500; width: 30%; }
.card .table td                  { padding: 0.5rem 0; border-bottom: 1px solid #f0f0ea; }
.card .table tr:last-child td    { border-bottom: none; }

/* ==================
   TRIAL CARDS (mobile)
   ================== */

.trial-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 12px 0.5rem;
}

.trial-card {
  display: block;
  background: var(--cat-card-bg);
  border: 1px solid #e5e5e5;
  border-left: 3px solid var(--cat-green-mid);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--cat-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background 0.12s, box-shadow 0.12s;
}

.trial-card--finished       { border-left-color: #ccc; }
.trial-card:hover           { background: #f4f4f0; box-shadow: 0 2px 5px rgba(0,0,0,0.09); text-decoration: none; color: var(--cat-text); }

.trial-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.trial-card-code   { font-size: var(--font-size-sm); font-weight: 600; color: var(--cat-green); font-family: var(--font-mono); }
.trial-card-name   { font-size: var(--font-size-base); font-weight: 500; margin-top: 0.2rem; }

.trial-card-status { font-size: 11px; border-radius: 4px; padding: 1px 7px; font-weight: 500; flex-shrink: 0; }
.trial-card-status--active   { background: #E1F5EE; color: #0F6E56; }
.trial-card-status--finished { background: #f0f0ec; color: #888; }

.trial-card-meta { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.35rem; }
.trial-card-tag  { font-size: 11px; background: #f0f0ec; color: #555; border-radius: 4px; padding: 1px 7px; }

/* The pencil sits over the card rather than inside it: the card is an <a>,
   and a <button> nested in an anchor is invalid and untappable. The wrapper
   is the positioning context. */
.trial-card-wrap { position: relative; }

.trial-card-edit {
  position: absolute;
  top: 0;
  right: 0;
  /* 44px tap target (Apple's minimum) without visually enlarging the icon. */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9a9a94;
  font-size: 15px;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

.trial-card-edit:active { background: rgba(0,0,0,0.06); color: var(--cat-green); }

/* Keep the status pill clear of the pencil's tap target. */
.trial-card-wrap .trial-card-header { padding-right: 34px; }

/* ==================
   MOBILE TRIAL HEADER
   ================== */

.mobile-trial-header {
  background: var(--cat-green);
  color: var(--cat-white);
  padding: 10px 14px 8px;
}

.mobile-trial-header-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2px;
}

.mobile-trial-back {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  flex-shrink: 0;
}

.mobile-trial-back:hover { color: var(--cat-white); }

.mobile-trial-code {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--cat-white);
}

.mobile-trial-name {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================
   MOBILE VIEW TABS
   ================== */

.mobile-view-tabs {
  display: flex;
  gap: 4px;
}

.mobile-view-tab {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.15);
  color: var(--cat-text);
  text-decoration: none;
  background: transparent;
  transition: background 0.12s;
}

.mobile-view-tab:hover            { background: rgba(0,0,0,0.05); color: var(--cat-text); text-decoration: none; }
.mobile-view-tab--active          { background: var(--cat-green); color: var(--cat-white); border-color: var(--cat-green); }

/* ==================
   FIELD ENTRY CARDS (mobile)
   ================== */

.field-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 4px 0.5rem;
}

.field-card {
  display: block;
  background: var(--cat-card-bg);
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 0.65rem 0.875rem;
  text-decoration: none;
  color: var(--cat-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background 0.12s, box-shadow 0.12s;
}

.field-card:hover { background: #f4f4f0; box-shadow: 0 2px 5px rgba(0,0,0,0.09); text-decoration: none; color: var(--cat-text); }

.field-card-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.field-card-plot-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  background: var(--cat-green);
  color: var(--cat-white);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  flex-shrink: 0;
}

.field-card-code {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--cat-green);
  font-family: var(--font-mono);
}

.field-card-name {
  font-size: var(--font-size-base);
  font-weight: 500;
  margin-top: 0.15rem;
}

.field-card-gen {
  font-size: 11px;
  color: var(--cat-muted);
  margin-left: 0.3rem;
}

/* In the desktop selection card the generation sits inside .field-card-header,
   which is already a flex row with its own gap — the margin above would double
   the spacing there. */
.field-card-header .field-card-gen { margin-left: 0; }

/* Program/Category pushed to the card's right edge. margin-left:auto absorbs
   the header's leftover space; flex-shrink:0 keeps the tags intact so a long
   name wraps instead of squeezing them. */
.field-card-tags {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

.field-card-has-plants {
  font-size: 16px;
  color: #3b82f6;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1;
}

.field-card-parents {
  font-size: 12px;
  color: var(--cat-muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* parents inline in header row (plant cards) */
.field-card-parents-inline {
  font-size: 12px;
  color: var(--cat-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* assigned seedkey row */
.plant-card-seedkey {
  font-size: 12px;
  font-weight: 600;
  color: var(--cat-green);
  font-family: var(--font-mono);
  margin-top: 0.15rem;
}

/* two-column layout when photo is present */
.plant-card-layout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.plant-card-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid #e0e0e0;
}

.plant-card-text {
  flex: 1;
  min-width: 0;
}

.plant-card-seedkey {
  font-size: 11px;
  color: #888;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  margin-top: 2px;
}

/* ==================
   MOBILE DETAIL PAGE
   ================== */

.mobile-detail-meta {
  padding: 6px 8px 4px;
  font-size: 12px;
  color: #555;
}

.mobile-detail-parents { margin-bottom: 2px; font-size: 12px; color: #555; }
.mobile-detail-loc     { font-size: 11px; color: #999; }

.mobile-detail-section {
  padding: 0 4px 12px;
}

.mobile-detail-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #999;
  padding: 6px 0 4px;
}

.mobile-photo-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.mobile-photo-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid #e0e0e0;
}

.mobile-marker-list { display: flex; flex-direction: column; gap: 4px; }

.mobile-marker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 12px;
}

.mobile-marker-plant {
  font-weight: 600;
  min-width: 28px;
  color: var(--cat-text);
}

.mobile-marker-badges { display: flex; flex-wrap: wrap; gap: 3px; }

/* ==================
   PLANT DETAIL REDESIGN
   ================== */

.pl-title-row { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.pl-title-row h1 { margin: 0; }
.pl-new-seed { font-size: 1rem; font-weight: 500; color: #7c5cbf; }

.pl-resistances { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 1rem; padding: 0.5rem 0.75rem; background: #faf9f6; border: 1px solid #e8e5de; border-radius: 7px; }
.pl-resistances-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #bbb; margin-right: 0.25rem; }

.pl-main-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.pl-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }

/* Carousel */
.pl-carousel-main { width: 50%; aspect-ratio: 4/3; background: #f5f4f0; border-radius: 8px; border: 1px solid #e5e5e5; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 0.5rem; cursor: pointer; }
.pl-carousel-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-carousel-main-add { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #ccc; font-size: 3.5rem; font-weight: 200; transition: background 0.15s, color 0.15s; }
.pl-carousel-main-add:hover { background: #eeecea; color: #9b7de8; }
.pl-carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.85); border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; padding: 0; }
.pl-carousel-nav:hover { background: #fff; }
.pl-carousel-nav--prev { left: 6px; }
.pl-carousel-nav--next { right: 6px; }

.pl-carousel-strip { display: flex; gap: 0.35rem; overflow-x: auto; padding-bottom: 2px; }
.pl-thumb { flex: 0 0 60px; height: 60px; border-radius: 5px; overflow: hidden; cursor: pointer; border: 2px solid transparent; position: relative; }
.pl-thumb:hover { border-color: #9b7de8; }
.pl-thumb.pl-thumb--active { border-color: #7c5cbf; }
.pl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-thumb-del { position: absolute; top: 1px; right: 1px; background: rgba(0,0,0,0.55); border: none; color: #fff; font-size: 10px; line-height: 1; width: 14px; height: 14px; border-radius: 2px; cursor: pointer; display: none; align-items: center; justify-content: center; padding: 0; }
.pl-thumb:hover .pl-thumb-del { display: flex; }
.pl-thumb-add { flex: 0 0 60px; height: 60px; border-radius: 5px; border: 1.5px dashed #ccc; background: #fafaf8; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #ccc; font-size: 1.6rem; font-weight: 300; transition: border-color 0.15s, color 0.15s; }
.pl-thumb-add:hover { border-color: #9b7de8; color: #7c5cbf; }

/* Edit panel */
.pl-edit { display: flex; flex-direction: column; gap: 0.75rem; }
.pl-field-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #999; display: block; margin-bottom: 3px; }
.pl-edit textarea { width: 100%; border: 1px solid #ddd; border-radius: 6px; padding: 0.45rem 0.6rem; font-size: 13px; font-family: inherit; resize: vertical; min-height: 72px; box-sizing: border-box; }
.pl-edit textarea:focus { outline: none; border-color: #9b7de8; }
.pl-edit select, .pl-edit input[type="text"] { width: 100%; border: 1px solid #ddd; border-radius: 6px; padding: 0.38rem 0.5rem; font-size: 13px; font-family: inherit; box-sizing: border-box; }
.pl-edit select:focus, .pl-edit input[type="text"]:focus { outline: none; border-color: #9b7de8; }
.pl-edit-row { display: flex; gap: 0.5rem; }
.pl-edit-row .pl-edit-field { flex: 1; min-width: 0; }
.pl-save-row { display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; padding-top: 0.25rem; }
.pl-save-msg { font-size: 12px; color: #5a8a5a; }

/* Info panels */
.pl-panel { background: #faf9f6; border: 1px solid #e8e5de; border-radius: 8px; padding: 0.875rem 1rem; }
.pl-panel-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #bbb; margin-bottom: 0.6rem; }
.pl-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.75rem; font-size: 13px; margin: 0; }
.pl-panel dt { color: #999; white-space: nowrap; }
.pl-panel dd { margin: 0; word-break: break-word; }
.pl-parent-block + .pl-parent-block { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 2px solid #d8d2c4; }
.pl-parent-label { font-size: 11px; font-weight: 700; color: #aaa; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
.pl-parent-name { font-weight: 600; font-size: 14px; color: #333; }
.pl-parent-seedkey { font-size: 12px; color: #888; margin-left: 0.4rem; }
.pl-parent-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-top: 4px; }
.pl-parent-remarks { font-size: 12px; color: #777; margin-top: 4px; font-style: italic; }
.pl-parent-label-strong { font-size: 13px; font-weight: 700; color: #2d6a4f; text-transform: uppercase; letter-spacing: 0.03em; margin-right: 0.35rem; }
.pl-parent-symbol { font-size: 22px; font-weight: 700; vertical-align: middle; line-height: 1; }
.pl-parent-name-plain { font-weight: 600; font-size: 14px; color: #333; }
.pl-parent-markers-label { font-size: 12px; color: #999; margin-right: 2px; }
.parent-sheet-pics { display: flex; flex-wrap: wrap; gap: 6px; }
.parent-sheet-pic { display: block; width: 90px; height: 90px; border-radius: 6px; object-fit: cover; }

/* Same source color-coding as the SeedBook Detail photo carousel
   (red = seed's own photo, blue = parent plant selection, green = field plot). */
.parent-sheet-pic-wrap.photo-thumb-wrap--red   .parent-sheet-pic { border: 3px solid #e74c3c; }
.parent-sheet-pic-wrap.photo-thumb-wrap--blue  .parent-sheet-pic { border: 3px solid #3b82f6; }
.parent-sheet-pic-wrap.photo-thumb-wrap--green .parent-sheet-pic { border: 3px solid #2d9c6e; }

/* Prevent iOS Safari from leaving accordion buttons in a dark :active state after tap */
#pl-accordion .accordion-button {
  -webkit-tap-highlight-color: transparent;
  background-color: #fff;
}
#pl-accordion .accordion-button:not(.collapsed) {
  background-color: var(--bs-accordion-active-bg);
}

/* ==================
   FIELD LIST DETAIL
   ================== */

.fl-info-line { font-size: 13px; color: #444; line-height: 1.4; }
.fl-parents-line { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.35rem; font-size: 12px; color: #666; }
.fl-parents-text { margin-right: 0.25rem; }

/* Mobile Seedbook bottom sheet. Its body is seed_books/show.html+mobile.erb
   (fetched with ?modal=1), which is light like every other mobile screen — so
   the sheet keeps the standard cream chrome. Tall by default: the seed detail
   has far more in it than a filter sheet. */
.sb-seed-sheet { height: 88vh; }
.sb-seed-sheet .offcanvas-body { padding: 0.5rem 0 0; }

/* Plot Detail's SeedKey — green and clickable, opening the Seedbook Detail
   (bottom sheet on mobile, right-side panel on desktop). Inherits the heading's
   size/weight so only the colour marks it as a link. */
.fl-seedkey-link {
  color: var(--cat-green);
  text-decoration: none;
}
.fl-seedkey-link:hover { text-decoration: underline; color: var(--cat-green); }

/* Mobile Notes card: stretch near screen edges and minimise inner padding so
   the remarks/action textareas reclaim space on small screens.
   (Only rendered in field_list/show.html+mobile.erb, so no media query needed.) */
.fl-notes-card { margin-left: -0.7rem; margin-right: -0.7rem; }
.fl-notes-card .card-body { padding: 0.3rem; }
.fl-notes-card .form-control { padding: 0.3rem 0.4rem; }
.fl-notes-card .pl-field-label { margin-bottom: 1px; }
.fl-notes-card .mb-2 { margin-bottom: 0.3rem !important; }

/* ==========================================================================
   Mobile Seedbook Detail (seed_books/show.html+mobile.erb)

   Used both as a full screen and as the body of the bottom sheet
   (shared/_seed_detail_sheet). Light cream palette like every other mobile
   screen — the dark .sb-root theme is desktop-only.
   ========================================================================== */

.sbm-detail { padding: 0.75rem 0.875rem 5rem; }

/* In the sheet the offcanvas supplies its own padding and the bottom nav is
   absent, so drop the screen-sized bottom gap. */
.sbm-detail--sheet { padding: 0 0.875rem 1.5rem; }

.sbm-title { margin-bottom: 0.85rem; }
.sbm-title-key {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cat-green);
}
.sbm-title-gen {
  font-size: 11px;
  font-weight: 600;
  color: var(--cat-muted);
  border: 1px solid #d8d2c4;
  border-radius: 4px;
  padding: 1px 6px;
}
.sbm-grown { color: var(--cat-green); font-weight: 700; }
.sbm-title-name { font-size: 1rem; font-weight: 600; margin-top: 2px; }
.sbm-title-info { font-size: 13px; color: #444; margin-top: 2px; }
.sbm-title-parents { font-size: 12px; color: var(--cat-muted); margin-top: 2px; }

.sbm-section {
  background: var(--cat-card-bg);
  border: 1px solid #e4ded0;
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.7rem;
}
.sbm-section-head {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin-bottom: 0.45rem;
}

/* Label above value rather than beside it — a phone has no room for a
   two-column field row once the value is a name or a remark. */
.sbm-field + .sbm-field { margin-top: 0.5rem; }
.sbm-field-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  margin-bottom: 1px;
}
.sbm-field-value { font-size: 13px; line-height: 1.4; word-break: break-word; }

.sbm-accordion .accordion-button { background: var(--cat-card-bg); }
.sbm-accordion .accordion-body { background: var(--cat-card-bg); }

/* Ancestor / child rows — the desktop 4-column tables don't fit a phone. */
.sbm-seed-row {
  display: block;
  padding: 0.45rem 0;
  border-bottom: 1px solid #eee7d9;
  text-decoration: none;
  color: var(--cat-text);
}
.sbm-seed-row:last-child { border-bottom: 0; }
.sbm-seed-row-top { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.sbm-seed-key {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--cat-green);
}
.sbm-seed-gen { font-size: 10px; color: var(--cat-muted); }
.sbm-seed-name { font-size: 13px; margin-top: 1px; }
.sbm-seed-parents, .sbm-seed-markers { font-size: 11px; color: var(--cat-muted); margin-top: 1px; }
.sbm-seed-badges { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 3px; }

/* ==================
   SEEDED TOGGLE (Plant Detail title row, desktop + mobile)
   ================== */

/* margin-left:auto pushes it to the title row's far right in every context
   (standalone, panels, mobile). Classed button, so forms.css leaves it alone —
   all look properties stated here. Solid green/red fills with white text are
   theme-independent, so one ruleset serves the dark desktop shell and the
   light mobile screens. --sb-green comes from the :root tokens in sidebar.css
   (loaded everywhere); --sb-good/--sb-bad are too light to carry white text. */
.pl-seeded-btn {
  margin-left: auto;
  border: none;
  border-radius: 999px;
  padding: 4px 13px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  white-space: nowrap;
}
.pl-seeded-btn .bi { font-size: 14px; color: #fff; }
.pl-seeded-btn:disabled { cursor: default; opacity: 0.85; }
.pl-seeded-btn--on  { background: var(--sb-green); }
.pl-seeded-btn--off { background: #c0392b; }
.pl-seeded-btn--on:not(:disabled):hover  { background: #12995f; }
.pl-seeded-btn--off:not(:disabled):hover { background: #d64533; }

/* Seed-quantity pill (shared/_seed_qty_bar) — sits beside the Seeded pill on
   the Plant Detail title row. Same colour language: background = state
   (grey not assessed, red none, green some), white glyphs. The 3-segment
   bar fills bottom-up; empty segments are translucent white so the scale
   stays visible on every background. Explicit backgrounds, so it reads the
   same on the light mobile screen and the dark desktop panel. */
.pl-seedqty-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: 999px;
  padding: 4px 13px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  white-space: nowrap;
}
.pl-seedqty-btn:disabled { cursor: default; opacity: 0.85; }
.pl-seedqty-btn--na { background: #6c757d; }
.pl-seedqty-btn--0  { background: #c0392b; }
.pl-seedqty-btn--1,
.pl-seedqty-btn--2,
.pl-seedqty-btn--3  { background: var(--sb-green, #198754); }
.pl-seedqty-btn--na:not(:disabled):hover { background: #7d868e; }
.pl-seedqty-btn--0:not(:disabled):hover  { background: #d64533; }
.pl-seedqty-btn--1:not(:disabled):hover,
.pl-seedqty-btn--2:not(:disabled):hover,
.pl-seedqty-btn--3:not(:disabled):hover  { background: #12995f; }
/* Bars are vertical, equal height, filling left→right (2026-09-02). DOM
   order is seg3,seg2,seg1 (kept for the fill JS), so row-reverse shows the
   fill growing left→right. */
.pl-seedqty-bar {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 2px;
}
.pl-seedqty-seg {
  width: 10px;
  height: 12px;
  border-radius: 1.5px;
  background: rgba(255, 255, 255, 0.3);
}
.pl-seedqty-seg--fill { background: #fff; }
/* Outline variant — used inside the desktop Notes card, left-aligned under
   Program/Category. Transparent ground, border + text + filled segments all
   in the state colour (via currentColor); tones picked for the dark panel.
   Must sit AFTER the solid rules: same-specificity background overrides. */
.pl-seedqty-btn--outline {
  background: transparent;
  border: 1px solid currentColor;
}
.pl-seedqty-btn--outline.pl-seedqty-btn--na { color: #9aa3ab; background: transparent; }
.pl-seedqty-btn--outline.pl-seedqty-btn--0  { color: #e0604f; background: transparent; }
.pl-seedqty-btn--outline.pl-seedqty-btn--1,
.pl-seedqty-btn--outline.pl-seedqty-btn--2,
.pl-seedqty-btn--outline.pl-seedqty-btn--3  { color: var(--sb-green, #2fbf7f); background: transparent; }
.pl-seedqty-btn--outline:not(:disabled):hover { background: rgba(255, 255, 255, 0.06); }
.pl-seedqty-btn--outline .pl-seedqty-seg { background: rgba(255, 255, 255, 0.22); }
.pl-seedqty-btn--outline .pl-seedqty-seg--fill { background: currentColor; }
.pl-seedqty-row { margin: 10px 0 2px; }
/* Compact per-row variant for the Plant List table's Seeds column — the
   detail pill's 3-segment bar in .pl-seeded-mini's footprint. Same palette:
   grey not assessed, red 0, green 1-3; segments fill bottom-up. Explicit
   backgrounds so it reads on the dark desktop table. */
.pl-seedqty-mini {
  display: inline-flex;
  flex-direction: row-reverse; /* DOM is seg3..seg1 — fill grows left→right */
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 34px;
  height: 22px;
  border: none;
  border-radius: 6px;
  padding: 0;
}
.pl-seedqty-mini:disabled { cursor: default; opacity: 0.85; }
.pl-seedqty-mini--na { background: #6c757d; }
.pl-seedqty-mini--0  { background: #c0392b; }
.pl-seedqty-mini--1,
.pl-seedqty-mini--2,
.pl-seedqty-mini--3  { background: var(--sb-green, #198754); }
button.pl-seedqty-mini--na:not(:disabled):hover { background: #7d868e; }
button.pl-seedqty-mini--0:not(:disabled):hover  { background: #d64533; }
button.pl-seedqty-mini--1:not(:disabled):hover,
button.pl-seedqty-mini--2:not(:disabled):hover,
button.pl-seedqty-mini--3:not(:disabled):hover  { background: #12995f; }
.pl-seedqty-mini-seg {
  width: 8px;
  height: 12px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.3);
}
.pl-seedqty-mini-seg--fill { background: #fff; }

/* Mobile Plant Detail: Seeded with the Seeds pill stacked under it, both on
   the right edge of the title row. The container takes over the seeded
   button's auto margin. */
.pl-status-col {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.pl-status-col .pl-seeded-btn { margin-left: 0; }
/* Desktop keeps the two pills on one row; when Seeded hides (any score set),
   the Seeds pill inherits its far-right position. */
.pl-seeded-btn[hidden] + .pl-seedqty-btn { margin-left: auto; }

/* Compact per-row variant for the Plant List table's Seed. column. Same
   green/red semantics as .pl-seeded-btn; span (viewers) and button
   (editors) share the look, cursor comes from forms.css's every-button
   rule so the static span stays a plain arrow. */
.pl-seeded-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  padding: 0;
  font-size: 13px;
  color: #fff;
}
.pl-seeded-mini--on  { background: var(--sb-green); }
.pl-seeded-mini--off { background: #c0392b; }
button.pl-seeded-mini--on:not(:disabled):hover  { background: #12995f; }
button.pl-seeded-mini--off:not(:disabled):hover { background: #d64533; }

/* ==================
   PLANT DETAIL MARKERS BLOCK (plant_list/_markers, desktop + mobile)
   ================== */

.pl-markers { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem; padding: 0.5rem 0.75rem; background: #faf9f6; border: 1px solid #e8e5de; border-radius: 7px; }
.pl-markers-row { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.pl-markers-row .pl-resistances-label { min-width: 54px; }
.marker-pills-x { color: #888; font-weight: 600; margin: 0 4px; }
.pl-markers-update {
  margin-left: auto;
  background: transparent;
  border: 1px solid #2d6a4f;
  color: #2d6a4f;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pl-markers-update:disabled { opacity: 0.6; cursor: default; }

/* ✎ Edit the raw markers string (desktop Plot Detail; edit_field local). */
.pl-markers-edit {
  margin-left: auto;
  background: transparent;
  border: 1px solid #c9c4b8;
  color: #6b7280;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
}
.pl-markers-edit-row { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.pl-markers-edit-row[hidden] { display: none; }
.pl-markers-edit-input {
  flex: 1;
  min-width: 160px;
  padding: 3px 8px;
  font-size: 13px;
  border: 1px solid #c9c4b8;
  border-radius: 6px;
}
.pl-markers-edit-save, .pl-markers-edit-cancel {
  background: transparent;
  border: 1px solid #2d6a4f;
  color: #2d6a4f;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pl-markers-edit-cancel { border-color: #b0aa9c; color: #6b7280; }
.pl-markers-edit-save:disabled { opacity: 0.6; cursor: default; }
.pl-markers-edit-msg { font-size: 12px; color: #6b7280; }

/* ── Mobile plant card, design "1c" (shared/_plant_card_mobile, 2026-09-01) ──
   Fixed 70px rail + fixed row order = position / name / codes / markers scan
   as columns down the list. Colour reference from the Claude Design spec. */
.pc-card {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 40, 25, 0.08);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pc-rail {
  flex: 0 0 70px;
  background: #F3F5EA;
  border-right: 1px solid #EAEBDF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 0;
}
.pc-pos {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 600;
  color: #1F5C41;
}
.pc-photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.pc-body { flex: 1; min-width: 0; padding: 11px 14px; }
.pc-row1 { display: flex; align-items: baseline; gap: 7px; margin-bottom: 3px; }
.pc-name {
  font-size: 16px;
  font-weight: 600;
  color: #16281F;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-gen { flex: 0 0 auto; font-size: 11px; font-weight: 600; color: #8A8F82; }
.pc-heart { flex: 0 0 auto; color: red; font-size: 13px; line-height: 1; }
.pc-chip {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6C7268;
  background: #EDEEE3;
  padding: 3px 6px;
  border-radius: 4px;
}
.pc-row2 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pc-codes {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
  color: #6C7268;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-row3 { display: flex; flex-wrap: wrap; gap: 4px; }
/* Seed status button — 0-3 score: bars fill bottom-up, count beside them.
   NULL grey, 0 red, 1-3 green (ink / tint / border per the spec's table).
   The ::after inset grows the tap target past 44px without moving layout. */
.pc-seedbtn {
  flex: 0 0 auto;
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  min-height: 30px;
  border-radius: 7px;
  border: 1px solid;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.pc-seedbtn::after { content: ""; position: absolute; inset: -8px; }
.pc-seedbtn:not(:disabled):active { transform: scale(0.96); }
.pc-seedbtn:disabled { cursor: default; }
.pc-seedbtn--na { color: #6C7268; background: #EDEEE3; border-color: #DDDFD1; }
.pc-seedbtn--0  { color: #C62F26; background: #FBE7E5; border-color: #F2C7C3; }
.pc-seedbtn--1, .pc-seedbtn--2, .pc-seedbtn--3 { color: #1B7F45; background: #E4F2E7; border-color: #BFE0C8; }
.pc-seedbars { display: flex; flex-direction: row-reverse; align-items: center; gap: 2px; }
.pc-seedbar { width: 8px; height: 12px; border-radius: 1px; background: rgba(108, 114, 104, 0.25); }
.pc-seedbar--fill { background: currentColor; }
.pc-seedcount {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
}
/* No count while unassessed — and :empty also drops its flex gap. */
.pc-seedcount:empty { display: none; }
