/* ================================================================
   Segment list (stacked boxes)
================================================================ */

#segments-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(235, 232, 228, 0.28);
  position: relative;
  z-index: 1;
}

.seg-box {  border: 1px solid rgba(200, 196, 190, 0.45);
  border-radius: 10px;
  background: rgb(252, 250, 247);   /* opaque (owner 2026-09-25: no transparent panels) */
  /* Slow out: this transition fires when leaving hover */
  transition: border-color 0.4s ease-out, background 0.4s ease-out, box-shadow 0.4s ease-out;
  flex-shrink: 0;
  overflow: hidden;
  user-select: text; -webkit-user-select: text;
  position: relative; /* needed for absolute scroll strip */
}
.seg-box:active { cursor: default; }
.seg-box.active {
  cursor: text;
}

.seg-box:hover {
  border-color: rgba(120, 140, 190, 0.75);
  background: rgb(240, 245, 255);   /* opaque */
  box-shadow: 0 2px 12px rgba(0,0,0,0.09);
  /* Fast in: overrides the base transition while :hover is active */
  transition: border-color 0.02s, background 0.02s, box-shadow 0.02s;
}
.seg-box.active {
  border-color: rgba(53, 116, 196, 0.70);
  background: rgb(248, 251, 255);   /* opaque */
  box-shadow: 0 2px 16px rgba(53,116,196,0.15);  /* left-edge inset highlight removed (Hadrian 2026-06-18) */
}
/* Branched segments: subtle left-edge tint to distinguish from originals */
.seg-box.seg-branch {
  border-left-color: rgba(120, 85, 190, 0.45);
  background: rgba(250, 248, 255, 0.60);
}
.seg-box.active.seg-branch {
  border-left-color: rgba(100, 70, 175, 0.65);
}

/* Segment targeted by the delete modal gets a warning tint */
.seg-box.pending-delete {
  border-color: rgba(200, 60, 50, 0.55);
  background: rgba(255, 230, 225, 0.85);
  box-shadow: 0 0 0 3px rgba(200, 60, 50, 0.28), 0 4px 20px rgba(200,60,50,0.18);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  position: relative;
  z-index: 9001; /* above the overlay (9000) so it shows through the dim */
}

.seg-box-body {
  padding: 4px 8px 8px 8px; /* bottom pad reserves room for the absolute scroll strip */
  display: flex;
  align-items: center;
  gap: 0;
  overflow: visible;
  position: relative;
}

.seg-ext-scroll {
  position: absolute;
  bottom: 2px;
  left: 8px;
  right: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  height: 6px;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(160,155,148,0.55) transparent;
}
.seg-ext-scroll-inner {
  height: 1px;
  display: block;
  min-width: 100%;
}
/* hide ext scrollbar when content fits */
.seg-ext-scroll.no-overflow { visibility: hidden; }


.seg-box-dot-col {
  flex: 0 0 72px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 10px;
  align-self: stretch;
}
.seg-box-dot {
  width: 6px;
  height: 6px;
  min-width: 6px;
  min-height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.seg-box-content {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-width: 0;
  padding: 4px 0;
  margin: -4px 0;
  overflow: hidden;
  contain: layout style;
}
.seg-box-content .cell-sides {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
}
/* (.seg-box .suggest-handle height 21px removed 2026-10-02: the spot is now an 18px letter slot in the text flow, css/13) */
/* N6 (Hadrian 2026-06-21): keep the caret BELOW the text line box (.ch = 15px x 1.4 = 21px) so it never
   grows the line it sits on. At 1.4em the caret resolved >= 21px (em tracked an inherited font-size, not
   the .ch 15px), so the caret's line was ~1px taller and moving the caret up/down shifted lines slightly. */
.seg-box .typing-cursor { height: 20px; }
.seg-box .typing-cursor-mirror { height: 1em; }

.seg-box-controls {
  flex: 0 0 auto;
  width: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding-right: 4px;
  opacity: 0.4;
  transition: opacity 0.15s;
}

.seg-box:hover .seg-box-controls,
.seg-box.active .seg-box-controls { opacity: 1; }

/* When the active segment is expanded, let text wrap */
.seg-box.expanded .seg-box-body {
  overflow-x: visible;
}
.seg-box.expanded .cell-letters {
  white-space: pre-wrap;
}

/* .seg-box-preview removed  -  inactive segments now use .cell-sides structure */
.seg-preview-left, .seg-preview-right { opacity: 0.75; }
.seg-preview-left  { color: hsl(215,60%,40%); opacity: 0.8; }
.seg-preview-right { color: hsl(0,60%,38%); opacity: 0.8; }
/* The four blue/red edge glyphs that used to appear here on hovering an inactive segment (small
   triangles at the outer ends and at the divider) are DELETED at the owner's instruction,
   2026-08-13: "you introduced some strange blue and red marks on-hover on the segments: I NEVER
   ASKED YOU TO DO THAT". Do not reintroduce them in any form. The half-zones stay clickable; only
   the decoration is gone. */
.seg-preview-left, .seg-preview-right { position: relative; cursor: pointer; }
.seg-box:not(.active) .seg-preview-left:hover,
.seg-box:not(.active) .seg-preview-right:hover { opacity: 1; text-shadow: 0 0 6px rgba(120,150,255,0.25); }
.seg-preview-sep   { color: rgba(130,125,118,0.45); font-size: 20px; }

/* ── Segment drag: insertion line + adjacent highlights ─────────── */
#seg-insert-line {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 3px;
  background: linear-gradient(90deg, rgba(53,116,196,0.85), rgba(90,155,230,0.65));
  border-radius: 2px;
  pointer-events: none;
  z-index: 20;
  transition: top 0.08s ease-out;
  transform: translateY(-50%);
}

/* Drag a segment INTO another (js/04h-seg-drop-merge.js): a glowing bar at the outer end / centre it will join,
   or a ring around the placeholder it will fill. Fixed + body-level, so it never shifts the segment layout. */
#seg-drop-marker {
  position: fixed;
  display: none;
  pointer-events: none;
  z-index: 60;
  border-radius: 2px;
  background: rgba(90,155,230,0.9);
  box-shadow: 0 0 8px 2px rgba(90,155,230,0.55);
}
#seg-drop-marker.seg-drop-slot {
  background: rgba(90,155,230,0.18);
  border: 2px solid rgba(90,155,230,0.9);
}

/* Drag ghost pill (appended to body by JS) */
.seg-drag-ghost {
  position: fixed;
  top: -9999px;
  left: -9999px;
  padding: 6px 14px;
  background: rgba(248, 251, 255, 0.92);
  border: 1px solid rgba(53, 116, 196, 0.55);
  border-radius: 16px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: hsl(215, 50%, 35%);
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  opacity: 0.88;
  pointer-events: none;
  z-index: 99999;
}

/* Edge tints on segments adjacent to the insertion line during drag */
.seg-box.seg-edge-above {
  box-shadow: inset 0 -5px 12px -2px rgba(72, 185, 115, 0.45);
  transition: box-shadow 0.05s;
}
.seg-box.seg-edge-below {
  box-shadow: inset 0 5px 12px -2px rgba(72, 185, 115, 0.45);
  transition: box-shadow 0.05s;
}

#segments-list-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 10px 14px;
  /* Grid keeps the + Segment button mathematically centered no matter which
     flanking definition box is visible (Sol review, WS19 s3). */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  justify-items: center;
  border: none;
  background: transparent;
  position: relative;
  z-index: 1;
}


/* Segment grips (owner 2026-07-28: "two handles, one on their far-left and one on their far-right edges" to drag
   the segment to another position or onto a project name; owner 2026-10-03: the six-dot grip, INSIDE the segment,
   taking its own room so the text never runs under it, and the SAME grip on every post-like Segment: Studio, the
   post card, a reply... (js/03g-seg-shell.js)). Quiet until hover so it never competes with the palindrome. */
/* Each side is a column of three grips (top / middle / bottom, js/03g-seg-shell.js): the middle one alone by default,
   the two corner ones from 5 text lines on (.seg-grip-4), all three from 8 lines on (.seg-grip-6). */
.seg-grip-col {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 14px;
}
.seg-grip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 22px;
  cursor: grab; user-select: none; -webkit-user-select: none;
  border-radius: 5px;
  color: var(--faint);
  opacity: 0.35;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.seg-grip-top, .seg-grip-bot { display: none; }
:is(.seg-grip-4, .seg-grip-6) .seg-grip-col { justify-content: space-between; }
:is(.seg-grip-4, .seg-grip-6) :is(.seg-grip-top, .seg-grip-bot) { display: inline-flex; }
.seg-grip-4 .seg-grip-mid { display: none; }
.seg-grip .ico { width: 14px; height: 14px; fill: currentColor; pointer-events: none; }
:is(.seg-box, .fc-cell):hover .seg-grip { opacity: 0.7; }
/* .seg-grip-pair: every grip of the Segment whose grip is hovered, the opposite side's too (js/03g-seg-shell.js). */
.seg-grip:hover, .seg-grip.seg-grip-pair { opacity: 1 !important; color: var(--theme); background: color-mix(in srgb, var(--theme) 10%, transparent); }
.seg-grip:active { cursor: grabbing; }
.seg-box-body > .seg-grip-left  { margin-right: 4px; }
.seg-box-body > .seg-grip-right { margin-left: 4px; }

/* Where the segment is about to land, when dragged onto a project tab. Deliberately loud: the owner asked for
   the drop target to be "visually well-communicated", and a tab is a small target that is easy to miss. */
.proj-tab.proj-tab-droptarget {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  background-color: rgba(53,116,196,0.18);
  box-shadow: 0 0 0 3px rgba(53,116,196,0.20);
}
.proj-tab.proj-tab-droptarget .proj-tab-label { font-weight: 700; }

/* W6 (owner 2026-08-02): profile Stats / Monogram Agronoms section chrome */
.pp-gami-head {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); margin: 14px 0 6px;
}
.pp-gami-section { padding: 2px 0 6px; }
