/* Planner: #/plans, its sheet and the Avui card (task M). Tokens only.
   The loud element is the drop that fills with the period probability; the rest is a quiet list. */

/* ---------- page header: back + add on one bar, title below (iOS large title) ---------- */
.pl-head { display: grid; gap: var(--s-1); }
.pl-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-1); }
.pl-add {
  appearance: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; margin-right: calc(-1 * var(--s-2));
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: none; color: var(--menstrual-ink);
}
.pl-add:active { background: var(--surface-3); }
.pl-sub { color: var(--text-2); font-size: var(--fs-sm); }

.pl-section { display: grid; gap: var(--s-2); }
.pl-section-title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 720; letter-spacing: -.01em; padding: 0 var(--s-1); }

/* ---------- list ---------- */
.pl-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface-2); border-radius: var(--r-lg); overflow: hidden;
}
.pl-list > li { position: relative; }
.pl-list > li + li::before, .pl-rows > .pl-row + .pl-row::before {
  content: ""; position: absolute; top: 0; left: calc(var(--s-4) + 30px + var(--s-3)); right: 0; height: 1px; background: var(--line);
}

/* ---------- a plan ---------- */
.pl-row {
  position: relative;
  appearance: none; border: 0; background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none;
  width: 100%; min-height: 64px; padding: var(--s-3) var(--s-4);
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; column-gap: var(--s-3); align-items: start;
  cursor: pointer; transition: background var(--t-fast);
}
.pl-row:active { background: var(--surface-3); }
.pl-row:focus-visible { outline-offset: -3px; border-radius: var(--r-lg); }
.pl-row-icon { display: inline-flex; padding-top: 2px; color: var(--ink); }
.pl-row-text { display: grid; gap: 2px; min-width: 0; }
.pl-row-title { font-weight: 650; font-size: var(--fs-md); line-height: 1.25; overflow-wrap: anywhere; }
.pl-row-date { display: flex; flex-wrap: wrap; column-gap: var(--s-2); font-size: var(--fs-sm); color: var(--text-2); line-height: 1.3; }
.pl-row-when { color: var(--ink); font-weight: 600; }
.pl-row-sentence { font-size: var(--fs-sm); line-height: 1.35; margin-top: 2px; }
.pl-row-sentence::before {     /* phase dot: support for the phase named in the sentence, never alone */
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: .08em; background: var(--pl-phase, transparent);
}
.pl-row:not(.has-phase) .pl-row-sentence::before { display: none; }   /* no phase stated: no dot */
.pl-row-note { font-size: var(--fs-xs); color: var(--text-2); line-height: 1.3; }
.pl-row.is-past .pl-row-title, .pl-row.is-past .pl-row-sentence { color: var(--text-2); }
.pl-row.is-past .pl-row-icon { opacity: .7; }

/* probability: a riso drop filled to the level, the number under it */
.pl-row-prob {
  display: grid; justify-items: center; gap: 0; min-width: 44px; padding-top: 2px;
  color: var(--text-2);
}
.pl-row-pct {
  font-family: var(--font-display); font-weight: 750; font-size: var(--fs-lg); letter-spacing: -.03em; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.pl-row-pct small { font-size: .6em; font-weight: 650; margin-left: 1px; }
.pl-row-prob.is-high, .pl-row-prob.is-high .pl-row-pct { color: var(--menstrual-ink); }
.pl-drop { display: block; overflow: visible; }
.pl-drop-fill { fill: var(--menstrual); mix-blend-mode: multiply; }
.pl-drop-line { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { .pl-drop-fill { mix-blend-mode: screen; } }

/* ---------- honesty line + past plans ---------- */
.pl-basis { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.4; padding: 0 var(--s-1); margin-top: calc(-1 * var(--s-3)); }
.pl-past { display: grid; gap: var(--s-2); }
.pl-past > summary {
  list-style: none; cursor: pointer; min-height: 44px; padding: 0 var(--s-1);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  font-family: var(--font-display); font-size: var(--fs-md); font-weight: 720; letter-spacing: -.01em;
}
.pl-past > summary::-webkit-details-marker { display: none; }
.pl-fold-chev { display: inline-flex; color: var(--text-3); transition: transform var(--t-fast); }
.pl-past[open] .pl-fold-chev { transform: rotate(90deg); }

/* ---------- empty ---------- */
.pl-empty { display: grid; gap: var(--s-3); justify-items: start; }
.pl-empty-art { display: flex; gap: var(--s-3); color: var(--ink); margin-bottom: var(--s-1); }
.pl-empty-art svg:nth-child(even) { transform: translateY(6px) rotate(-6deg); }
.pl-empty-art svg:nth-child(odd) { transform: rotate(4deg); }

/* ---------- Avui card ---------- */
.pl-card { padding: var(--s-4) 0 var(--s-1); gap: var(--s-1); }
.pl-card > h3 { padding: 0 var(--s-5); }
.pl-card-body { display: grid; }
.pl-rows { display: grid; }
.pl-card .pl-row { padding-inline: var(--s-5); }
.pl-card .pl-rows > .pl-row + .pl-row::before { left: calc(var(--s-5) + 30px + var(--s-3)); }
.pl-more, .pl-invite {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 48px; padding: var(--s-2) var(--s-5);
  color: var(--menstrual-ink); font-weight: 600; font-size: var(--fs-sm); text-decoration: none;
}
.pl-more { justify-content: space-between; box-shadow: inset 0 1px 0 var(--line); }
.pl-more:active, .pl-invite:active { background: var(--surface-3); }
.pl-more:focus-visible, .pl-invite:focus-visible { outline-offset: -3px; border-radius: var(--r-lg); }
.pl-chev { display: inline-flex; color: var(--text-3); }
.pl-card.is-invite { padding: var(--s-4) 0 var(--s-2); }
.pl-invite { color: var(--text); font-weight: 500; line-height: 1.35; }
.pl-invite-icon { flex: none; display: inline-flex; color: var(--ink); }
.pl-invite-text { flex: 1; }

/* ---------- sheet ---------- */
.pl-sheet { display: grid; gap: var(--s-4); }
.pl-form { min-width: 0; }
.pl-form-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  min-height: 52px; padding: var(--s-2) var(--s-4);
}
.pl-form-row[hidden] { display: none; }
.pl-form-row.is-title { padding: 0; }
.pl-form-label { font-size: var(--fs-md); }
.pl-input {
  width: 100%; min-height: 52px; padding: 0 var(--s-4);
  border: 0; border-radius: var(--r-lg); background: transparent; color: var(--text);
  font: inherit; font-size: max(16px, 1rem); font-weight: 600;   /* < 16px makes iOS zoom in */
}
.pl-input::placeholder { color: var(--text-3); font-weight: 400; }
.pl-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ovulation); }
.pl-hint { font-size: var(--fs-sm); color: var(--text-2); padding: 0 var(--s-4); margin-top: calc(-1 * var(--s-2)); }
.pl-hint:empty { display: none; }
/* the date reads as an iOS inline date pill */
.pl-date {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer;
  min-height: 44px; padding: 0 var(--s-3); border-radius: var(--r-sm);   /* 44 pt: the whole pill is the target */
  background: var(--surface-3); color: var(--text);
  font: inherit; font-size: max(16px, 1rem); font-variant-numeric: tabular-nums;
}
.pl-date:focus-visible { outline: 3px solid var(--ovulation); outline-offset: 2px; }
.pl-date::-webkit-date-and-time-value { text-align: right; }

.pl-form-group { display: grid; gap: var(--s-2); }
.pl-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: var(--s-2); }
.pl-icon-btn {
  appearance: none; border: 0; cursor: pointer;
  aspect-ratio: 1; min-height: 52px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.pl-icon-btn:active { transform: scale(.94); }
.pl-icon-btn[aria-checked="true"] { background: var(--bg); box-shadow: inset 0 0 0 2.5px var(--ink); }
.pl-preview > h3 { font-size: var(--fs-lg); }
.pl-preview p { font-size: var(--fs-sm); line-height: 1.4; }
.pl-preview .pl-preview-basis { color: var(--text-2); }
