/* Daily Life Doc, round 12 (zone RP; the page "Habits, Rules and Texts", Part 10): the parts of the page Rules that are
   new in round 12. Pause all's line under the patient's name (js/flow/rules-pause.js), the Daily limit's row with − and
   + (rules-limit.js), and the three parts of a rule by hand, When, Then and Stop when, with the sentence, "What the
   patient gets" and the server's reason beside them (rules-form.js, rules-form-then.js, rules-make.js; also inside a
   rule card's Edit). A text document: each part a name and its fields, borderless tinted fields, one type scale (the
   tokens --t-* of css/base.css); every change moves with the tokens --m-* (a part drawn again fades in, the frame
   grows open and folds away). Pink stays for the care team's own lines; the reason is the yellow of "Could not". */

/* ---- Pause all: the line under the patient's name while it holds ---- */
.rl-pl { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 6px 10px 16px;
  border-radius: 16px; background: var(--try-bg); color: var(--try-d); font-size: var(--t-s); font-weight: 600; line-height: 1.4; }
.rl-res { min-height: 40px; padding: 0 12px; border-radius: 12px; font-size: var(--t-s); font-weight: 600; color: inherit; transition: opacity var(--m-press) ease; }
.rl-res:active { opacity: .55; }
.rl-ps .sh-opt { width: 100%; }
.rl-pdate { display: block; width: 100%; margin-top: 8px; }
.rl-pdate[hidden] { display: none; }
.rl-pfl { display: block; margin-bottom: 14px; font-size: var(--t-s); font-weight: 600; color: var(--ink2); }
[data-pause-all][hidden] { display: none; }

/* A message's images on a rule's row. */
.rl-pics { display: flex; gap: 6px; margin-top: 6px; }
.rl-pics[hidden] { display: none; }
.rl-pics img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--soft); }

/* A rule held by Pause all: its own switch stands quieter. */
.rl-sw.held { opacity: .45; }

/* ---- The Daily limit: one row, − and + ---- */
.rl-lim { display: flex; align-items: center; gap: 14px; padding: 12px 0 13px; }
.rl-lim .rl-an small + small { margin-top: 1px; }
/* "Today: 6 of 8 sent" opens the list of the messages counted today (REVIEW C9); the same small grey words. */
.rl-today { display: block; margin-top: 1px; padding: 0; font-size: var(--t-sm); line-height: 1.45; color: var(--ink2); text-align: left;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.rl-today:disabled { text-decoration: none; cursor: default; }
.rl-sent { list-style: none; margin: 0; padding: 0 0 12px; display: grid; gap: 6px; font-size: var(--t-sm); line-height: 1.45; }
.rl-sent li { display: flex; gap: 12px; }
.rl-sent .rl-st { flex: none; min-width: 64px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.rl-step { display: flex; align-items: center; gap: 2px; flex: none; }
.rl-step button { width: 44px; height: 44px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--ink); background: var(--soft);
  transition: transform var(--m-press) var(--ease-out), opacity var(--m-press) ease; }
.rl-step button:active { transform: scale(.92); }
.rl-step button[disabled] { opacity: .35; }
.rl-step .num { min-width: 36px; text-align: center; font-size: var(--t-l); font-weight: 600; font-variant-numeric: tabular-nums; }
.rl-n { margin-left: 8px; margin-right: auto; }
.rl-new[disabled] { opacity: .4; }

/* ---- + Rule and Edit: the frame (form and side by side on a wide screen) ---- */
.rm { margin-top: 6px; padding: 14px 18px 16px; border-radius: 22px; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.rl-rule + .rl-slot .rm, .rl-slot .rm { margin: 6px -18px; border-radius: 0; box-shadow: none; background: var(--bg); padding: 14px 18px 16px; }
.rl-one .rl-slot .rm { margin: 2px 0 0; border-radius: 22px; background: var(--surface); }
.rm-main { display: grid; gap: 18px; }
@media (min-width: 900px) { .rm-main { grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; } }
.rm-acts { display: flex; gap: 10px; margin-top: 16px; }
.rm-acts .btn { height: 44px; padding: 0 18px; border-radius: 14px; font-size: var(--t-s); }

/* The three parts: a quiet name over (phone) or beside (wide) its fields. */
.rf-row { display: grid; gap: 6px; padding: 10px 0 12px; }
.rf-row + .rf-row, [data-part] + [data-part] .rf-row { border-top: 1px solid var(--line); }
@media (min-width: 900px) { .rf-row { grid-template-columns: 96px minmax(0, 1fr); column-gap: 14px; align-items: start; } }
.rf-k { font-size: var(--t-sm); font-weight: 600; line-height: 40px; color: var(--ink2); }
.rf-v { display: grid; gap: 8px; min-width: 0; }
.rf-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rf-sel, .rf-num, .rf-in { min-height: 40px; border: 0; outline: 0; border-radius: 12px; background: var(--soft); color: var(--ink); font: inherit; font-size: var(--t-s); }
.rf-sel { max-width: 100%; padding: 0 30px 0 12px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(135deg, var(--ink2) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.rf-v > .rf-sel { justify-self: start; font-weight: 600; }
.rf-num { width: 92px; padding: 0 12px; }
.rf-time { width: 128px; } .rf-date { width: 160px; } .rf-wide { width: 100%; }
.rf-in { display: block; width: 100%; padding: 10px 12px; resize: none; line-height: 1.45; }
.rf-sel:focus-visible, .rf-num:focus-visible, .rf-in:focus-visible { box-shadow: 0 0 0 2px var(--ink3); }
.rf-x { font-size: var(--t-sm); line-height: 1.45; color: var(--ink2); }
p.rf-x { margin: 0; }
.rf-sub { margin: 0; font-size: var(--t-xs); line-height: 1.45; color: var(--ink2); }
.rf-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.rf-chip { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: var(--t-sm); color: var(--ink2); background: var(--soft);
  transition: background-color var(--m-step) ease, color var(--m-step) ease; }
.rf-chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); font-weight: 600; }
.rf-look { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.rf-look label { display: grid; gap: 4px; }
.rf-look .rf-sel { width: 100%; }

/* A message's images: thumbnails, Upload, Make with AI. */
.rf-imgs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rf-thumb { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--soft); }
.rf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rf-thx { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 16px; line-height: 1; }
.rf-up { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 12px; background: var(--soft); font-size: var(--t-s); font-weight: 600; cursor: pointer; }
.rf-up.busy { color: var(--ink2); pointer-events: none; }

/* The side: the sentence, the lock screen, the reason. */
.rm-side { display: grid; gap: 12px; align-content: start; }
.rm-say { margin: 0; font-size: var(--t-s); font-weight: 500; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; border-radius: 6px; }
.rm-lock { display: grid; gap: 6px; }
.rm-lock[hidden] { display: none; }
.rm-lab { font-size: var(--t-xs); font-weight: 600; letter-spacing: .02em; color: var(--ink2); }
.rm-ntf { padding: 10px 14px 11px; border-radius: 16px; background: color-mix(in srgb, var(--ink) 88%, transparent); color: var(--on-ink); }
.rm-ntf b { display: block; font-size: var(--t-xs); font-weight: 600; opacity: .85; }
.rm-ntf span { display: block; margin-top: 1px; font-size: var(--t-sm); line-height: 1.4; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rm-bad { margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--try-bg); color: var(--try-d); font-size: var(--t-sm); line-height: 1.45; }
.rm-bad[hidden] { display: none; }

/* ---- Send later: the rows at the end of the care team's chat (js/flow/rules-later.js) ---- */
.rl-later:empty { display: none; }
.rl-later { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 8px 0 4px; }
.rl-lr { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 14px; border-radius: 14px; background: color-mix(in srgb, var(--care) 12%, var(--surface)); font-size: var(--t-sm); line-height: 1.4; color: var(--ink2); }
.rl-lw { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-lw b { font-weight: 600; color: var(--care-d); }
.rl-lr button { min-height: 36px; padding: 0 8px; font-size: var(--t-sm); font-weight: 600; color: var(--ink2); transition: opacity var(--m-press) ease; }
.rl-lr button:active { opacity: .55; }
/* Fixer FR (WALK-3 fault 21): the Edit sheet's day and time, a tap opens Send later's day row and clock. */
.rl-lt { display: block; width: 100%; margin-top: 12px; padding: 12px 0; text-align: left; font-size: var(--t-m); color: var(--ink2); }
.rl-lt b { font-weight: 600; color: var(--ink); }
.rl-lt:active { opacity: .55; }

@media (prefers-reduced-motion: reduce) {
  .rf-chip, .rl-step button { transition: none; }
}
