/* Ciclos e detalhe do ciclo.
   Page-scoped rules only; shared components live in ../app.css.
   Everything hangs off .cy-page (the [data-swap-content] wrapper of both
   templates), so nothing here can leak into another screen. */

.cy-page .panel-head h2{margin:0}
.cy-panel{margin-bottom:24px}
.cy-count{margin-left:auto;color:var(--sec);font-size:13px;font-weight:500;text-align:right}
.cy-page .notice p{margin:0}
.cy-page .notice p+p{margin-top:4px}
.cy-notice-ttl{font-weight:700}
.cy-notice-list{margin:4px 0;padding-left:18px}
.cy-notice-list li+li{margin-top:2px}

/* Secondary line under a value: counts, dates, the cycle status. */
.cy-meta{display:block;margin-top:6px;font-size:13px;color:var(--sec);line-height:1.45}
.cy-flag{color:var(--ink);font-weight:600}
.cy-why{overflow-wrap:anywhere}
.cy-page .cy-meta a{color:var(--accent-strong);font-weight:600;text-decoration:underline;text-underline-offset:3px}

/* ---- trigger form (Ciclos) ---- */
.cy-trigger-grid{display:grid;grid-template-columns:minmax(240px,320px) minmax(0,1fr);gap:20px 32px;align-items:start}
.cy-moments{border:0;padding:0;margin:0;min-width:0}
.cy-moments legend{padding:0;margin:0 0 6px;font-size:13.5px;font-weight:600;color:var(--ink);line-height:1.35}
.cy-moment-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
/* The whole option is the target; the name is the radio's label, the line
   under it its description (aria-labelledby / aria-describedby). */
.cy-moment{display:flex;align-items:flex-start;gap:12px;min-height:44px;padding:12px 14px;
  border:1px solid var(--line);border-radius:var(--r-sm);background:var(--surface);cursor:pointer;
  transition:border-color .15s ease,background-color .15s ease}
.cy-moment:hover{border-color:var(--field-line)}
.cy-moment:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}
.cy-moment:has(input:focus-visible){outline:2px solid var(--focus);outline-offset:2px}
/* Where :has() works the option carries the ring; the radio's own would double it. */
@supports selector(:has(*)){.cy-moment input:focus-visible{outline:none}}
.cy-moment input{flex:none;margin-top:1px}
.cy-moment-txt{display:flex;flex-direction:column;gap:3px;min-width:0}
.cy-moment-name{font-size:14px;font-weight:700;color:var(--ink);line-height:1.35}
.cy-moment-help{font-size:13px;color:var(--sec);line-height:1.45}
.cy-actions-hint{flex:1 1 320px;margin:0;font-size:13px;color:var(--sec);line-height:1.45}
@media (max-width:960px){.cy-trigger-grid{grid-template-columns:minmax(0,1fr)}}
@media (max-width:600px){.cy-moment-list{grid-template-columns:minmax(0,1fr)}}

/* ---- cycles table ---- */
.cy-table td{vertical-align:top}
.cy-table thead th{white-space:nowrap}
.cy-comp{width:20%}
.cy-comp-link{font-size:15px;font-weight:700;color:var(--ink);letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.cy-result{display:inline-flex;border-radius:999px}
.cy-result .st{white-space:nowrap}
.cy-none{color:var(--ter)}

/* Below 720px each row becomes a block (.cy-stack): every value sits beside
   its column name instead of under a header row the eye has to travel back to. */
@media (max-width:720px){
  .cy-stack thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .cy-stack,.cy-stack tbody,.cy-stack tr,.cy-stack td{display:block;width:auto}
  .cy-page .table-wrap>.cy-stack{min-width:0}
  .cy-stack tr{padding:14px 16px;border-bottom:1px solid var(--line-2)}
  .cy-stack tbody tr:last-child{border-bottom:0}
  .cy-stack tbody td{padding:0;border:0;text-align:left}
  .cy-stack td+td{margin-top:10px}
  .cy-stack td[data-label]{display:grid;grid-template-columns:minmax(0,8.5em) minmax(0,1fr);column-gap:12px;align-items:start}
  .cy-stack td[data-label]::before{content:attr(data-label);grid-column:1;grid-row:1 / span 4;
    font-size:12.5px;font-weight:600;color:var(--sec);line-height:1.4;padding-top:3px}
  .cy-stack td[data-label]>*{grid-column:2;justify-self:start}
  .cy-stack td[data-label]>.cy-meta{margin-top:4px}
  .cy-table td+td{margin-top:12px}
  .cy-runs td[data-label]{grid-template-columns:minmax(0,7.5em) minmax(0,1fr)}
  /* The row, not each block-level cell, takes the hover tint once stacked. */
  .cy-stack tr[data-href]:is(:hover,:focus-within)>td{background:transparent}
  .cy-stack tr[data-href]:is(:hover,:focus-within){background:var(--row-hover)}
}

/* What each recommendation means, under the table. */
.cy-legend{padding:16px 22px 18px;border-top:1px solid var(--line-2)}
.cy-legend-ttl{margin:0 0 10px;font-size:13.5px;font-weight:700;color:var(--ink)}
.cy-legend dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px 24px;margin:0}
.cy-legend dl>div{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.cy-legend dt,.cy-legend dd{margin:0}
.cy-legend dd{font-size:13px;color:var(--sec);line-height:1.45}
.cy-legend-foot{margin:14px 0 0;font-size:13px;color:var(--sec);line-height:1.45}
.cy-legend-foot a{color:var(--accent-strong);font-weight:600;text-decoration:underline;text-underline-offset:3px}

.cy-empty{padding:28px 22px;text-align:center;color:var(--sec);font-size:14px;line-height:1.5}
.cy-empty p{margin:0 auto;max-width:62ch}
.cy-empty .cy-empty-ttl{margin-bottom:6px;font-weight:700;color:var(--ink)}
.cy-empty a{color:var(--accent-strong);font-weight:600;text-decoration:underline;text-underline-offset:3px}

/* ---- cycle page: one column per moment, in the order the close runs ---- */
.cy-steps{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);margin:0;padding:0;list-style:none}
.cy-step{display:flex;flex-direction:column;gap:12px;min-width:0;padding:18px 22px 20px;border-right:1px solid var(--line-2)}
.cy-step:last-child{border-right:0}
.cy-step-ttl{margin:0}
.cy-step-help{margin:0;font-size:13px;color:var(--sec);line-height:1.45}
.cy-step-result{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.cy-step-result p{margin:0}
.cy-step .cy-meta{margin-top:0}
.cy-step-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:auto;padding-top:4px}
.cy-step-actions form{margin:0}
.cy-step-why{margin:-4px 0 0}
.cy-steps-foot{margin:0;padding:12px 22px 16px;border-top:1px solid var(--line-2);font-size:13px;color:var(--sec);line-height:1.45}
@media (max-width:960px){
  .cy-steps{grid-auto-flow:row;grid-template-columns:minmax(0,1fr)}
  .cy-step{border-right:0;border-bottom:1px solid var(--line-2)}
  .cy-step:last-child{border-bottom:0}
}

/* ---- run history ---- */
.cy-runs-wrap{--table-min:780px}
.cy-runs td{vertical-align:top}
.cy-runs .st{white-space:nowrap}
.cy-runs .cy-why{max-width:48ch}
.cy-run-link{font-weight:700;color:var(--ink)}
.cy-tag{display:inline-block;margin-left:6px;padding:1px 7px;border:1px solid var(--line);border-radius:6px;
  font-size:12px;font-weight:600;color:var(--sec);vertical-align:1px}
.cy-who{overflow-wrap:anywhere}
