/* css/slot-rows.css — .sc-slot timeline-row BEM component: container/grid layout, time column, rail/connector node, body/card, grip handle, type chip, slot logo, info (label/notes), on-now badge, tags, hover action buttons, icon buttons. State classes and standalone affordances live in css/slot-row-states.css (Phase 65 CSS-01 split). Imported into components layer. */

/* ── .sc-timeline container ─── */
.sc-timeline {
  display: flex;
  flex-direction: column;
}

/* ── .sc-slot grid block ─── */
.sc-slot {
  display: grid;
  grid-template-columns: 74px 26px 1fr;
  align-items: stretch;
  position: relative;
}

@media (max-width: 680px) {
  .sc-slot { grid-template-columns: 58px 22px 1fr; }
}

/* ── Time column ─── */
.sc-slot__time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  padding-top: 16px;
  padding-right: 4px;
}

.sc-slot__time .t {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

.sc-slot__time .dur {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 4px;
  white-space: nowrap;
}

/* ── Rail + connector node ─── */
.sc-slot__rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.sc-slot__rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-subtle);
}

.sc-slot:first-child .sc-slot__rail::before { top: 22px; }
.sc-slot:last-child  .sc-slot__rail::before { bottom: calc(100% - 22px); }

.sc-slot__node {
  position: absolute;
  top: 22px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-surface-3);
  border: 2px solid var(--border-strong);
  z-index: 1;
}

/* ── Body + card ─── */
.sc-slot__body {
  padding: 8px 0 14px 10px;
  min-width: 0;
}

.sc-slot__card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 13px 14px 13px 8px;
  /* Default transition: safe for structural hover (not written by tick loop) */
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
}

.sc-slot__card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-2);
}

/* D-V2.0-NO-TICK-TRANSITION: active/past state is written every 100ms — must be instant */
.sc-slot--active .sc-slot__card,
.sc-slot--past   .sc-slot__card {
  transition: transform .12s;
}

/* ── Grip handle ─── */
.sc-slot__grip {
  flex: none;
  width: 22px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  cursor: grab;
  opacity: 0;
  transition: opacity .15s, color .15s;
  touch-action: none;
}

.sc-slot__card:hover .sc-slot__grip { opacity: 1; }
.sc-slot__grip:hover  { color: var(--text-muted); }
.sc-slot__grip:active { cursor: grabbing; }

/* ── Type chip — D-V2.0-COLOR-MIX: rgba fallback before every color-mix ─── */
.sc-slot__chip {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  /* D-V2.0-COLOR-MIX fallback */
  background: rgba(136, 136, 136, 0.16);
  background: color-mix(in oklab, var(--chip, #888) 16%, transparent);
  color: var(--chip, #888);
  border: 1px solid rgba(136, 136, 136, 0.30);
  border: 1px solid color-mix(in oklab, var(--chip, #888) 30%, transparent);
}

/* ── Slot logo thumbnail — 28px leading artwork (LOG-08) ─── */
.sc-slot__logo {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  background: var(--bg-surface-3);
  display: block;
}
.sc-slot__logo:not([src]),
.sc-slot__logo[src=""] { display: none; }

/* ── Info: label + notes ─── */
.sc-slot__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sc-slot__label {
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-slot__label .ph {
  color: var(--text-faint);
  font-weight: 500;
  font-style: italic;
}

.sc-slot__notes {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── On-now badge (Option A: always in DOM, CSS hides/shows) ─── */
.sc-slot__live {
  display: none; /* hidden by default; shown when parent has --active */
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-amber);
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}

.sc-slot--active .sc-slot__live {
  display: flex; /* shown by parent state class */
}

/* Pulsing dot — CSS-only animation, never restarted by tick (Option A) */
.sc-slot__live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-amber);
  animation: sc-pulse 1.6s ease-in-out infinite;
}

@keyframes sc-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

/* ── Tags ─── */
.sc-slot__tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.sc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  background: var(--bg-surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  cursor: pointer; /* attachment buttons need pointer; spans are inert */
}

.sc-tag svg { width: 12px; height: 12px; }

/* Countdown tag — D-V2.0-COLOR-MIX */
.sc-tag--cd {
  color: var(--accent-blue);
  border-color: rgba(111, 150, 196, 0.35);
  border-color: color-mix(in oklab, var(--accent-blue) 35%, transparent);
  background: rgba(111, 150, 196, 0.12);
  background: color-mix(in oklab, var(--accent-blue) 12%, transparent);
}

/* Count-up tag — D-V2.0-COLOR-MIX */
.sc-tag--cu {
  color: var(--accent-green);
  border-color: rgba(111, 174, 143, 0.35);
  border-color: color-mix(in oklab, var(--accent-green) 35%, transparent);
  background: rgba(111, 174, 143, 0.12);
  background: color-mix(in oklab, var(--accent-green) 12%, transparent);
}

/* Hold (manual-advance) tag */
.sc-tag--hold {
  color: var(--text-muted);
  letter-spacing: .06em;
}

/* Alert tag */
.sc-tag--alert {
  color: var(--color-warning);
}

/* UX-03: Day tag — muted/surface variant; tabular-nums for consistent digit width */
.sc-tag--day {
  color: var(--text-muted);
  background: var(--bg-surface-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ── Hover action buttons ─── */
.sc-slot__acts {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  opacity: 0;
  transition: opacity .15s;
}

.sc-slot__card:hover .sc-slot__acts { opacity: 1; }

/* Coarse-pointer (touch): always show grip + acts — but NOT in shared/readonly
   view (CR-03), so :not(.timetable-panel--readonly) scopes the force-show. */
@media (pointer: coarse) {
  .timetable-panel:not(.timetable-panel--readonly) .sc-slot__acts { opacity: 1; }
  .timetable-panel:not(.timetable-panel--readonly) .sc-slot__grip { opacity: 1; }
}

/* CR-03: shared-view (readonly) defense-in-depth — hide every mutation
   affordance introduced this phase. The JS handlers also early-return on
   state.isSharedView (authoritative); this CSS gate is belt-and-braces and
   wins over the coarse-pointer force-show via :not() scoping above. */
.timetable-panel--readonly .sc-slot__acts,
.timetable-panel--readonly .sc-slot__grip,
.timetable-panel--readonly .sc-add-row {
  display: none;
}

/* ── Icon buttons ─── */
.sc-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.sc-iconbtn:hover {
  background: var(--bg-surface-3);
  color: var(--text-primary);
}

.sc-iconbtn--danger:hover {
  /* D-V2.0-COLOR-MIX */
  background: rgba(239, 91, 91, 0.14);
  background: color-mix(in oklab, var(--color-error) 14%, transparent);
  color: var(--color-error);
}

.sc-iconbtn svg { width: 17px; height: 17px; }

/* 260601-ns3 T2-A: 44px width floor on touch — scoped to non-readonly so shared-view inert buttons stay compact */
@media (pointer: coarse) {
  .timetable-panel:not(.timetable-panel--readonly) .sc-slot__acts .sc-iconbtn {
    min-width: 44px;
    min-height: 44px;
  }
  .timetable-panel:not(.timetable-panel--readonly) .sc-slot__acts {
    gap: var(--space-2);
  }
  /* UX-01 (Phase 68): grip intentionally inherits base touch-action:none (slot-rows.css ~line 120)
     so touch drag can capture the gesture. The former pan-y override has been removed. */
}
