/* Readability checker (/readability-checker). Builds on word-counter.css (same two-pane box and views). */
.rc-tool { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }

/* Highlights drawn behind the text box */
.rc-hl mark { color: transparent; border-radius: 3px; padding: 0; }
.rc-hl .rc-m-hard { background: rgba(250, 204, 21, .32); }
.rc-hl .rc-m-vhard { background: rgba(244, 63, 94, .2); }
.rc-hl .rc-m-pass { box-shadow: inset 0 -3px 0 rgba(37, 82, 232, .75); background: rgba(37, 82, 232, .1); }
.rc-hl .rc-m-adv { box-shadow: inset 0 -3px 0 rgba(147, 51, 234, .7); }
.rc-hl .rc-m-cx { box-shadow: inset 0 -2px 0 rgba(15, 138, 110, .8); }
.rc-hl .rc-m-simp { background: rgba(15, 138, 110, .16); box-shadow: inset 0 -2px 0 rgba(15, 138, 110, .9); }
.rc-hl .rc-m-rep { background: rgba(234, 88, 12, .16); box-shadow: inset 0 -3px 0 rgba(234, 88, 12, .8); }
:root[data-theme="dark"] .rc-hl .rc-m-hard { background: rgba(250, 204, 21, .22); }
:root[data-theme="dark"] .rc-hl .rc-m-vhard { background: rgba(244, 63, 94, .24); }

/* Highlight switches under the text */
.rc-marks { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 16px; border-top: 1px solid var(--border); }
.rc-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text-2); border-radius: 999px; padding: 4px 10px 4px 8px; font: 600 .8rem var(--font); cursor: pointer; white-space: nowrap; }
.rc-chip:hover { border-color: var(--border-2); color: var(--text); }
.rc-chip i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.rc-chip em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 700; }
.rc-chip.is-on { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.rc-chip.is-on em { color: var(--accent); }
.rc-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.m-hard i { background: rgba(234, 179, 8, .75); }
.m-vhard i { background: rgba(244, 63, 94, .7); }
.m-pass i { background: #2552e8; }
.m-adv i { background: #9333ea; }
.m-cx i { background: #0f8a6e; }
.m-simp i { background: rgba(15, 138, 110, .45); box-shadow: inset 0 -2px 0 #0f8a6e; }
.m-rep i { background: #ea580c; }

/* Score view */
.rc-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: stretch; }
.rc-grade { border-radius: 14px; background: linear-gradient(135deg, var(--accent-soft), transparent 140%); border: 1px solid var(--border); padding: 12px 16px; min-width: 0; }
.rc-grade small, .rc-ringbox small { display: block; font-size: .78rem; font-weight: 600; color: var(--text-3); }
.rc-grade > b { display: block; font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: -.02em; line-height: 1.15; }
.rc-grade > span { font-size: .84rem; color: var(--text-2); }
.rc-ringbox { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; }
.rc-ease-l { display: block; font-size: 1rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.rc-ring { position: relative; width: 64px; height: 64px; flex: none; }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.rc-ring i { position: absolute; inset: 0; border-radius: 50%; --p: 0; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--bg-soft) 0); transition: --p .5s cubic-bezier(.2, .7, .2, 1); }
.rc-ring i::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--card); }
.rc-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.05rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.rc-fitrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 12px; align-items: end; }
.rc-fit { border-radius: 12px; padding: 8px 12px; border: 1px solid var(--border); min-height: 54px; display: flex; flex-direction: column; justify-content: center; }
.rc-fit b { font-size: .98rem; }
.rc-fit span { font-size: .8rem; color: var(--text-3); }
.rc-fit.is-ok { background: var(--human-soft); border-color: transparent; } .rc-fit.is-ok b { color: var(--human-ink); }
.rc-fit.is-warn { background: var(--mixed-soft); border-color: transparent; } .rc-fit.is-warn b { color: var(--mixed-ink); }
.rc-fit.is-bad { background: var(--ai-soft); border-color: transparent; } .rc-fit.is-bad b { color: var(--ai-ink); }
.rc-ease { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin: 12px 0 0; padding: 0; }
.rc-ease li { font-size: .68rem; line-height: 1.2; color: var(--text-3); text-align: center; padding: 6px 2px; border-radius: 6px; background: var(--bg-soft); }
.rc-ease li b { display: block; font-size: .78rem; color: var(--text-2); }
.rc-ease li.is-on { background: var(--accent); color: var(--on-accent); } .rc-ease li.is-on b { color: var(--on-accent); }
.rc-tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.rc-tips li { position: relative; padding: 8px 12px 8px 30px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--border); font-size: .88rem; color: var(--text); line-height: 1.45; }
.rc-tips li::before { content: ""; position: absolute; left: 12px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
[dir="rtl"] .rc-tips li { padding: 8px 30px 8px 12px; } [dir="rtl"] .rc-tips li::before { left: auto; right: 12px; }

/* Empty state */
.rc-empty { display: grid; gap: 12px; justify-items: start; }
.rc-empty p { margin: 0; }

/* Fix these first */
.rc-gain { margin: -2px 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--human-soft); color: var(--human-ink); font-size: .86rem; font-weight: 600; }
.rc-fixes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rc-fix { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: start; border: 1px solid var(--border); border-radius: 12px; background: var(--card); padding: 9px 12px; font: inherit; color: var(--text); }
button.rc-fix { cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
button.rc-fix:hover { border-color: var(--accent); background: var(--card-2); }
button.rc-fix:active { transform: scale(.995); }
.rc-fix:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rc-fix-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: .74rem; font-weight: 800; margin-top: 1px; }
.rc-fix-tx { flex: 1; min-width: 0; }
.rc-fix-tx b { display: block; font-size: .9rem; line-height: 1.35; overflow-wrap: anywhere; }
.rc-fix-tx small { display: block; font-size: .8rem; color: var(--text-2); line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.rc-fix-go { flex: none; font-size: .76rem; font-weight: 700; color: var(--accent); align-self: center; }
.rc-fix-ok { padding: 10px 12px; border-radius: 12px; background: var(--human-soft); color: var(--human-ink); font-size: .88rem; font-weight: 600; }

/* Before and after */
.rc-snapbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 8px 8px 8px 12px; border: 1px dashed var(--border-2); border-radius: 12px; font-size: .82rem; color: var(--text-2); }
.rc-snapbar .btn { flex: none; }
.rc-compare { margin-top: 12px; border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; background: var(--card-2); }
.rc-cmp-head { display: flex; justify-content: space-between; align-items: center; }
.rc-cmp-head b { font-size: .92rem; }
.rc-cmp-sum { margin: 4px 0 6px; font-size: .84rem; font-weight: 600; color: var(--text-2); }
.rc-cmp-sum.is-up, .rc-d.is-up { color: var(--human-ink); }
.rc-cmp-sum.is-down, .rc-d.is-down { color: var(--ai-ink); }
.rc-cmp th[scope="row"] { font-weight: 600; font-size: .84rem; color: var(--text); text-align: start; text-transform: none; letter-spacing: 0; }
.rc-cmp tr:last-child th, .rc-cmp tr:last-child td { border-bottom: 0; }
.rc-tool .wcw-out-foot .wcw-hint { display: none; }
.rc-tool .wcw-out-foot { justify-content: flex-end; }
.rc-cmp td.num, .rc-cmp th:not(:first-child) { text-align: end; font-variant-numeric: tabular-nums; }
.rc-cmp td.num { font-weight: 700; white-space: nowrap; }

/* Paragraphs */
.rc-paras { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.rc-para { display: block; width: 100%; text-align: start; border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: 7px 12px 9px; cursor: pointer; font: inherit; color: var(--text); }
.rc-para:hover { border-color: var(--border-2); background: var(--card-2); }
.rc-para:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rc-para-top { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; margin-bottom: 5px; }
.rc-para-top b { font-weight: 700; color: var(--text-2); }
.rc-para-top em { font-style: normal; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rc-para-bar { display: block; height: 6px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.rc-para-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.rc-para.is-hard .rc-para-bar i { background: rgb(234, 179, 8); }
.rc-para.is-veryhard .rc-para-bar i { background: rgb(244, 63, 94); }
.rc-open li em { color: #ea580c; }

/* Sentences view */
.rc-sents { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rc-sent { display: block; width: 100%; text-align: start; border: 1px solid var(--border); border-inline-start-width: 4px; border-radius: 10px; background: var(--card); padding: 8px 12px; cursor: pointer; font: inherit; color: var(--text); }
.rc-sent:hover { border-color: var(--border-2); background: var(--card-2); }
.rc-sent:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rc-sent.is-hard { border-inline-start-color: rgb(234, 179, 8); }
.rc-sent.is-veryhard { border-inline-start-color: rgb(244, 63, 94); }
.rc-sent-top { display: flex; justify-content: space-between; gap: 8px; font-size: .76rem; margin-bottom: 2px; }
.rc-sent-top b { font-weight: 700; color: var(--text-2); }
.rc-sent-top em { font-style: normal; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rc-sent-tx { display: block; font-size: .88rem; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.rc-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; align-items: end; }
.rc-bars li { display: grid; gap: 2px; text-align: center; font-size: .74rem; color: var(--text-3); }
.rc-bar { display: flex; align-items: flex-end; height: 70px; background: var(--bg-soft); border-radius: 6px; overflow: hidden; }
.rc-bar i { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; min-height: 2px; }
.rc-bars li:nth-child(5) .rc-bar i { background: rgb(234, 179, 8); } .rc-bars li:nth-child(6) .rc-bar i { background: rgb(244, 63, 94); }
.rc-bars b { color: var(--text); font-size: .82rem; font-variant-numeric: tabular-nums; }

/* Formulas and words */
.rc-ftable td small { display: block; font-size: .74rem; color: var(--text-3); font-weight: 500; }
.rc-ftable td.num { text-align: end; font-weight: 800; font-size: 1.02rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-ftable td:last-child { color: var(--text-2); font-size: .84rem; }
.rc-ftable th:nth-child(2) { text-align: end; }
.rc-ftable .rc-avg td { background: var(--accent-soft); }
.rc-ftable .rc-avg td.num { color: var(--accent); }
.rc-cx { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rc-cx li { display: inline-flex; align-items: baseline; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: .84rem; }
.rc-cx li em { font-style: normal; font-size: .74rem; font-weight: 700; color: var(--accent); }
.rc-cx li small { color: var(--human-ink); font-size: .76rem; }
#rcSimpTable td.num { text-align: end; }
#rcSimpTable[hidden], .rc-tool [hidden] { display: none; }

@media (max-width: 640px) {
  .rc-top { grid-template-columns: 1fr; }
  .rc-snapbar { flex-direction: column; align-items: stretch; text-align: center; padding: 10px; }
  .rc-fix-go { display: none; }
  .rc-fitrow { grid-template-columns: 1fr; }
  .rc-marks { padding: 8px 12px; gap: 5px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .rc-marks::-webkit-scrollbar { display: none; }
  .rc-ease li { font-size: .6rem; padding: 5px 1px; }
}
@media (max-width: 960px), (orientation: portrait) {
  .rc-marks { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}
@media (prefers-reduced-motion: reduce) { .rc-ring i { transition: none; } button.rc-fix { transition: none; } }
