/* Program-scoped index (no toolbar): the quiet "All cycles" link plus New
   Cycle, replacing the old Show All / Show Active & Upcoming button pair. */
.cycles-program-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* Cycles index table — keep date columns on a single line and constrain
   the Elements column so long lists don't dominate the row width. */
.cycles-table th,
.cycles-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.cycles-table .col-nowrap {
  white-space: nowrap;
}

.cycles-table td.col-elements {
  white-space: normal;
}

/* Cycle row temporal highlighting — current rows are unmarked so they read
   as the default state. Past rows are visually de-emphasized; future rows
   get a faint accent-cycle wash. */
.cycle-row-future {
  background-color: color-mix(in oklch, var(--accent-cycle) 6%, transparent);
}

.cycle-row-past {
  background-color: var(--surface-muted);
  color: var(--text-muted);
}

.cycle-row-past a {
  color: var(--text-muted);
}

/* Season grouping in the cycles index -- a season's header row is bolded
   and its child block rows are visually indented directly beneath it. */
.cycle-row-season .cycle-name-cell {
  font-weight: 600;
}

.cycle-name-child-indent {
  color: var(--text-muted);
}

/* Cycle show page -- Views::Cycles::Show composes CycleBrief/WeekStrip
   full-width above a two-column area (FocusElements, WorkoutsTable). */
.cycle-page-columns {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 2fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .cycle-page-columns {
    grid-template-columns: 1fr;
  }

  .cycle-week-strip {
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  }
}

@media (max-width: 768px) {
  .cycle-week-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

.attach-block-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tracked-element chip row for the cycle-planner element picker (new/edit
   settings forms) — Components::ElementChip, the kit's quiet chip that
   every movement is drawn with, so cycle and daily-plan chips stay
   visually consistent. Not used by the cycle show page any more (task 14: that
   page's element list is Views::Cycles::FocusElements, styled by
   .cycle-focus-*). */
.cycle-element-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.cycle-element-chips .element-chip-body {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* Cycle modal body */

.cycle-dates {
  margin-bottom: 0.5rem;
}

.cycle-notes {
  margin-top: 1rem;
}

/* Two-column layout for athlete + coach notes; stacks under 640px so
   the modal stays readable on phones. */
.cycle-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .cycle-notes {
    grid-template-columns: 1fr;
  }
}

.cycle-note-card {
  margin: 0;
}

.cycle-note-body {
  white-space: pre-wrap;
  margin: 0;
}

.cycle-elements-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.cycle-modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #e5e7eb);
}

/* Cycles index status pill — inline in the Cycle name cell, next to the
   link. Planning::CycleStatus.for's four states. */
.cycle-status-pill {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 0.0625rem 0.4375rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.cycle-status-active {
  background-color: var(--alert-success-bg);
  border-color: var(--alert-success-border);
  color: var(--alert-success-text);
}

.cycle-status-ending_soon {
  background-color: var(--alert-warning-bg);
  border-color: var(--alert-warning-border);
  color: var(--alert-warning-text);
}

.cycle-status-upcoming {
  background-color: var(--badge-info-bg);
  border-color: var(--badge-info-border);
  color: var(--badge-info-text);
}

.cycle-status-past {
  background-color: var(--surface-muted);
  border-color: var(--border);
  color: var(--text-muted);
}

/* Cycles index Focus cell — a season prints its emphasis prose instead of
   element chips; a cycle's chips (first three) are followed by a plain
   "+N" marker, never another chip, when more are tracked. */
.cycles-focus-emphasis {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.cycles-focus-more {
  display: inline-block;
  margin-left: 0.125rem;
  padding: 0.0625rem 0.3125rem;
  border: 1px solid var(--border);
  border-radius: 0.1875rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Cycles index gap row — a stretch of calendar between two top-level
   cycles with nothing scheduled (Planning::CoverageGaps). */
.cycle-gap-row td {
  background-color: var(--alert-warning-bg);
  color: var(--text-muted);
  font-style: italic;
}

/* Cycle page brief -- the chip row under the cycle's page head (reuses
   .week-brief-chips/.brief-chip* from weekly_planner.css verbatim, which
   loads on every page). */
.cycle-brief {
  box-sizing: border-box;
  background: var(--surface-white);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 0.625rem 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Cycle page week strip -- one Views::Cycles::WeekCell per coverage cell,
   the door into weekly planning. Top edge colored by cell.state, current
   week gets an outline. */
.cycle-week-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cycle-week-cell-head {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}

.cycle-week-cell {
  box-sizing: border-box;
  background: var(--surface-white);
  color: var(--text-primary);
  border-radius: 6px;
  border-top: 4px solid var(--border);
  padding: 0.5rem;
  min-height: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
}

.cycle-week-cell-planned {
  border-top-color: var(--alert-success-border);
}

.cycle-week-cell-drafting {
  border-top-color: var(--alert-warning-border);
}

.cycle-week-cell-unplanned {
  border-top-color: var(--border);
}

.cycle-week-cell-current {
  outline: 2px solid var(--primary-color);
}

.cycle-week-cell-index {
  font-size: 0.75rem;
}

.cycle-week-cell-date {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.cycle-week-cell-stimuli {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem;
}

.cycle-week-cell-foot {
  margin-top: auto;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Cycle page focus elements -- one list, replacing the old tracked-element
   chip row. Views::Cycles::FocusElements / Views::Cycles::FocusElementRow. */
.cycle-focus-list {
  display: flex;
  flex-direction: column;
}

.cycle-focus-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--border);
}

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

.cycle-focus-row-header {
  padding-bottom: 0.25rem;
}

.cycle-focus-column-header {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.cycle-focus-star-form {
  display: inline-flex;
}

.cycle-focus-star {
  background: none;
  border: none;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--border);
  cursor: pointer;
}

.cycle-focus-star-active {
  color: var(--alert-warning-border);
}

.cycle-focus-name {
  min-width: 0;
}

.cycle-focus-bar {
  width: 6rem;
}

.cycle-focus-uses {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: right;
  min-width: 1.5rem;
}

.cycle-focus-actions {
  display: flex;
  gap: 0.5rem;
}

.cycle-focus-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.cycle-focus-legend {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.cycle-focus-blocks {
  margin-top: 1rem;
}

.cycle-focus-block-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.cycle-focus-block-name {
  min-width: 0;
}

.cycle-focus-block-dates {
  font-size: 0.8125rem;
}

.cycle-focus-block-status {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.cycle-focus-block-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.cycle-focus-error {
  grid-column: 1 / -1;
  color: var(--danger-color-dark);
  font-size: 0.6875rem;
}

/* Cycle page workouts table -- Views::Cycles::WorkoutsTable, grouped by
   week under collapsible details. */
.cycle-workouts-week {
  margin-bottom: 0.5rem;
}

.cycle-workouts-week-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.25rem 0;
}

.cycle-workouts-table {
  width: 100%;
}

.cycle-workouts-heavy {
  text-align: right;
}

.stacked-bar-segment-cycle {
  background-color: var(--accent-cycle);
}

