/* «Мої правила»: the rules panel, the bar and the block card in the demo ticket, the checklist in the confirm card.
   Tokens only (tokens.css); neutral greys, no blue tint. */

/* ---------- ticket: bar above Лонг / Шорт ---------- */
.rl-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s2);
  padding: 6px var(--s2); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--panel2);
  font-size: var(--fs-2xs); color: var(--muted); }
.rl-bar-txt { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.rl-bar-txt > span { line-height: 1.35; }
.rl-bar .icon { width: 14px; height: 14px; flex: none; }
.rl-bar.is-near { border-color: var(--warning); color: var(--text); }
.rl-bar.is-near .icon { color: var(--warning); }
.rl-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--text);
  font: 500 var(--fs-2xs)/1.3 var(--sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; white-space: nowrap; }
.rl-link:hover { color: #fff; }
.rl-link .icon { width: 14px; height: 14px; }
#ticketPanel .tf[hidden] { display: none !important; }

/* ---------- ticket: block card instead of the form ---------- */
.rl-block { display: grid; gap: var(--s2); margin: var(--s3); padding: var(--s3); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--red); border-radius: var(--r-md); background: var(--panel2); font-size: var(--fs-xs); }
.rl-block[hidden] { display: none; }
.rl-block p { margin: 0; line-height: 1.45; color: var(--text); }
.rl-block-head { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); }
.rl-block-head .icon { width: 16px; height: 16px; color: var(--red); }
.rl-count { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.rl-count b { font: 600 var(--fs-md) var(--mono); color: var(--text); }
.rl-unlock { justify-self: start; }
.rl-note { margin: 0; font-size: var(--fs-2xs); color: var(--muted); line-height: 1.4; }

/* ---------- confirm card: violations, checklist, setup, emotion ---------- */
.rl-check { display: grid; gap: 6px; margin: var(--s2) 0; padding-top: var(--s2); border-top: 1px solid var(--border); font-size: var(--fs-xs); }
.rl-viol { display: grid; gap: 2px; }
.rl-viol > b { font-size: var(--fs-2xs); color: var(--warning); font-weight: 600; }
.rl-okline { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: var(--fs-2xs); }
.rl-okline .icon { width: 14px; height: 14px; }
.rl-sub { display: block; margin-top: 2px; font-size: var(--fs-2xs); font-weight: 600; color: var(--muted); text-transform: none; }
.rl-tick { display: flex; align-items: flex-start; gap: var(--s2); cursor: pointer; line-height: 1.35; }
.rl-tick input { margin: 2px 0 0; flex: none; accent-color: var(--text); }
.rl-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.rl-row-top { align-items: flex-start; }
.rl-row > .muted { flex: none; font-size: var(--fs-2xs); padding-top: 3px; }
.rl-setup { min-width: 0; flex: 1; max-width: 190px; height: var(--h-sm); font-size: var(--fs-xs); }
.rl-emo { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.rl-chip { height: 22px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--r-pill); background: transparent;
  color: var(--muted); font: 500 var(--fs-2xs) var(--sans); cursor: pointer; }
.rl-chip:hover { color: var(--text); border-color: var(--border-strong); }
.rl-chip[aria-pressed="true"] { color: var(--bg); background: var(--text); border-color: var(--text); }
#confirmOk:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- the «Правила» panel ---------- */
#rulesPanel { overflow: auto; }
.rl-form { display: grid; gap: var(--s3); padding: var(--s3); font-size: var(--fs-xs); }
.rl-head { display: grid; gap: var(--s2); }
.rl-lead { margin: 0; color: var(--muted); line-height: 1.45; }
.rl-switch { display: flex; align-items: center; gap: var(--s2); cursor: pointer; }
.rl-today { display: grid; gap: 3px; padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel2); }
.rl-trow { display: flex; justify-content: space-between; gap: var(--s2); }
.rl-trow b { font-weight: 500; }
.rl-group { display: grid; gap: var(--s2); margin: 0; padding: var(--s2) 0 0; border: 0; border-top: 1px solid var(--border); min-width: 0; }
.rl-group legend { padding: 0 var(--s2) 0 0; font-size: var(--fs-2xs); font-weight: 600; color: var(--muted); }
.rl-form.is-off .rl-group:not(:last-of-type) { opacity: .55; }
.rl-field { display: grid; gap: 3px; min-width: 0; }
.rl-lbl { color: var(--text); }
.rl-hint { color: var(--soft, var(--muted)); font-size: var(--fs-2xs); }
.rl-line { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); align-items: end; }
.rl-num, .rl-sel, .rl-text { width: 100%; min-width: 0; height: var(--h-sm); padding: 0 var(--s2); border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--bg); color: var(--text); font: var(--fs-xs) var(--mono); }
.rl-text { font-family: var(--sans); }
textarea.rl-text { height: auto; padding: 6px var(--s2); resize: vertical; line-height: 1.4; }
.rl-num:focus, .rl-sel:focus, .rl-text:focus { outline: none; border-color: var(--border-strong); box-shadow: 0 0 0 1px var(--muted); }
.rl-days { display: flex; flex-wrap: wrap; gap: 4px; }
.rl-day { position: relative; }
.rl-day input { position: absolute; opacity: 0; pointer-events: none; }
.rl-day span { display: inline-grid; place-items: center; min-width: 32px; height: 24px; border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--muted); font-size: var(--fs-2xs); cursor: pointer; user-select: none; }
.rl-day input:checked + span { color: var(--bg); background: var(--text); border-color: var(--text); }
.rl-day input:focus-visible + span { box-shadow: 0 0 0 2px var(--muted); }
