/* AIChecker.html (js/ai-checker.js); page layout classes come from css/resistor-values.css */
/* the intro paragraph runs a little wider on this page than the shared 78ch */
.rv-sub { max-width: 85ch; }
.ac-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 0 0 18px; }
.ac-quick > div { background: #fff; border: 2px solid #434343; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 3px 5px rgba(0,0,0,.2); }
.ac-quick span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #4a5a5f; }
.ac-quick b { font-size: 17px; color: #1a3a40; }
.ac-quick small { font-size: 12.5px; color: #4a5a5f; }

.ac-tool { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
/* the text box grows so the input card is as tall as the Checks card beside it */
.ac-incard { display: flex; flex-direction: column; }
.ac-incard > .rv-card-b { flex: 1 1 auto; display: flex; flex-direction: column; }
.ac-incard .ac-text { flex: 1 1 auto; }
.ac-incard .ac-actions { margin-top: 0; }   /* buttons, samples and status sit above the text box */
.ac-incard .ac-text { margin-top: 10px; }
.ac-count { font-weight: 400; letter-spacing: 0; text-transform: none; color: #4a5a5f; font-size: 12px; }
.ac-text { width: 100%; min-height: 300px; resize: vertical; font: 15px/1.55 Roboto, Arial, sans-serif; padding: 10px 12px; border: 1.5px solid #6b7b80; border-radius: 8px; color: #1a2a2e; }
.ac-text:focus { outline: 2px solid #1a6475; outline-offset: 1px; }
.ac-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ac-btn { font: 700 14px Roboto, Arial, sans-serif; padding: 8px 16px; border: 2px solid #1a6475; border-radius: 8px; background: #1a6475; color: #fff; cursor: pointer; }
.ac-btn:hover { background: #134e5c; }
.ac-btn-2 { background: #fff; color: #1a6475; }
.ac-btn-2:hover { background: #e8f0f3; }
.ac-file { position: relative; overflow: hidden; display: inline-block; }
.ac-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ac-try { font: 600 12.5px Roboto, Arial, sans-serif; padding: 3px 9px; margin: 0 4px 4px 0; border: 1px solid #c5d0d3; border-radius: 999px; background: #fff; color: #1a6475; cursor: pointer; }
.ac-try:hover { background: #e8f0f3; border-color: #1a6475; }
.ac-detstate { font-size: 13px; color: #4a5a5f; margin: 4px 0 0; }
.ac-ok { color: #1e5a2a; }
.ac-bad { color: #a3312a; }
.ac-prog { margin-top: 6px; }
.ac-prog-t { height: 8px; background: #e3eaec; border-radius: 4px; overflow: hidden; }
.ac-prog-t span { display: block; height: 100%; width: 0; background: #1a6475; transition: width .2s; }
.ac-prog small { color: #4a5a5f; }

/* checks panel */
.ac-sw { display: flex; gap: 6px; align-items: baseline; font-size: 13.5px; margin: 3px 0; cursor: pointer; }
.ac-sw small { color: #4a5a5f; font-weight: 400; }
.ac-sw input { flex: none; }
/* KasperCalc teal controls, as on the spring calculators */
.ac-tool input[type=checkbox], .ac-tool input[type=radio], .ac-results input[type=radio] { accent-color: #1a6475; width: 13px; height: 13px; margin: 0; cursor: pointer; }
.ac-tool input[type=range] { accent-color: #1a6475; }
.ac-sw { align-items: center; }
/* tooltips in the Checks card open above their row, inside the card */
.ac-checkcard .ac-sw, .ac-checkcard .ac-inl { position: relative; }
.ac-checkcard .ac-tip { position: static; margin-left: 2px; }
.ac-checkcard .tooltip-box { left: 0; right: auto; width: auto; max-width: 260px; min-width: 180px; bottom: calc(100% + 4px); }
.ac-grp { border-top: 1px solid #e3eaec; padding: 6px 0; }
.ac-sub > summary { cursor: pointer; list-style-position: outside; margin-left: 14px; }
.ac-grp-h { margin: 2px 0 4px; }   /* the two top sections always stay open */
.ac-sub > summary .ac-sw { display: inline-flex; margin: 2px 0; }
.ac-sub { margin: 2px 0 2px 14px; }
.ac-rule { margin-left: 30px; font-size: 13px; }
.ac-inl { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 6px 0; flex-wrap: wrap; }
.ac-inl select { font: 13px Roboto, Arial, sans-serif; padding: 3px 6px; border: 1px solid #6b7b80; border-radius: 6px; }
.ac-sens { border-top: 1px solid #e3eaec; padding-top: 8px; }
.ac-sens input { flex: 1; min-width: 120px; }
.ac-small { font-size: 12px; color: #4a5a5f; margin: 6px 0; }
.ac-muted { color: #6b7b80; font-size: 13px; }
.ac-link { background: none; border: 0; padding: 0; color: #1a6475; text-decoration: underline; cursor: pointer; font: inherit; }

/* results */
.ac-results { margin-top: 18px; }
.ac-status { font-weight: 700; color: #1a6475; margin: 0 0 6px; min-height: 1em; }
.ac-rgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }   /* every result card full width */
.ac-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* two columns inside a full-width card (score, why, stats); one column on narrow screens */
.ac-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 32px; align-items: start; }
.ac-2col > div > .ac-sub-h:first-child { margin-top: 0; }
@media (max-width: 700px) { .ac-2col { grid-template-columns: minmax(0, 1fr); } }
.ac-view { display: flex; gap: 10px; flex-wrap: wrap; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12.5px; }
.ac-view label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.ac-out { white-space: pre-wrap; overflow-wrap: anywhere; font: 15.5px/1.75 Roboto, Arial, sans-serif; color: #1a2a2e; max-height: 70vh; overflow-y: auto; padding: 4px 2px; }
.ac-out [data-s], .ac-out [data-r] { cursor: pointer; }
.ac-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin-bottom: 8px; }
.ac-legend span { padding: 0 3px; }
.ac-detail { border-top: 1px solid #e3eaec; margin-top: 10px; padding-top: 8px; font-size: 13.5px; }
.ac-card { border-left: 4px solid #c5d0d3; background: #f7fafb; padding: 6px 10px; margin: 0 0 6px; border-radius: 0 6px 6px 0; }
.ac-fix { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ac-btn-s { font: 600 12px Roboto, Arial, sans-serif; padding: 2px 8px; border: 1px solid #1a6475; border-radius: 6px; background: #fff; color: #1a6475; cursor: pointer; }
.ac-btn-s:hover { background: #e8f0f3; }

/* sentence shading: diverging green (human) to red (AI) */
.s-hu2 { background: #b9e4c3; }
.s-hu1 { background: #e2f4e6; }
.s-ai1 { background: #fde3c8; }
.s-ai2 { background: #f8b9a8; }
/* rule underlines */
.m-ai { text-decoration: underline dotted #c0392b 2px; text-underline-offset: 3px; }
.m-human { text-decoration: underline dotted #1e7a3a 2px; text-underline-offset: 3px; }
.m-punct { text-decoration: underline dotted #7d3cb5 2px; text-underline-offset: 3px; }
.m-format { text-decoration: underline dotted #555 2px; text-underline-offset: 3px; }
/* grammar underlines */
.g-spell { text-decoration: underline solid #d0021b 2px; text-underline-offset: 3px; }
.g-gram { text-decoration: underline solid #1f5fbf 2px; text-underline-offset: 3px; }
.g-punct { text-decoration: underline solid #d48a00 2px; text-underline-offset: 3px; }
.g-caps { text-decoration: underline solid #138a8a 2px; text-underline-offset: 3px; }
.g-style { text-decoration: underline solid #8a979b 2px; text-underline-offset: 3px; }
.ac-c-ai { border-left-color: #c0392b; } .ac-c-human { border-left-color: #1e7a3a; } .ac-c-punct { border-left-color: #7d3cb5; }
.ac-c-format { border-left-color: #555; } .ac-c-spell { border-left-color: #d0021b; } .ac-c-gram { border-left-color: #1f5fbf; }
.ac-c-caps { border-left-color: #138a8a; } .ac-c-style { border-left-color: #8a979b; } .ac-c-sent { border-left-color: #1a6475; }
.ac-card.ac-c-punct { border-left-color: #d48a00; }

/* score */
.ac-verdict { font-size: 22px; font-weight: 800; color: #1a3a40; }
.ac-verdict b { font-size: 26px; }
.ac-v-ai { color: #b03a22; } .ac-v-human { color: #1e6a34; } .ac-v-mixed { color: #8a5a00; } .ac-v-off, .ac-v-short { color: #4a5a5f; }
.ac-gauge { height: 14px; border-radius: 7px; background: linear-gradient(90deg, #7fcf93, #f1e08a 50%, #ee8a6f); position: relative; margin: 8px 0 2px; }
.ac-gauge span { position: absolute; left: 0; top: -3px; bottom: -3px; border-right: 3px solid #1a2a2e; }
.ac-gauge-k { display: flex; justify-content: space-between; font-size: 11px; color: #4a5a5f; }
.ac-vnote { font-size: 13.5px; margin: 8px 0; }
.ac-sub-h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #4a5a5f; margin: 10px 0 4px; }
.ac-share { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #e3eaec; }
.ac-sh-ai { background: #f0a58e; } .ac-sh-n { background: #e3eaec; } .ac-sh-hu { background: #93d3a3; }
.ac-share-k { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; margin-top: 4px; }
.ac-share-k i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.ac-k-ai { background: #f0a58e; } .ac-k-n { background: #d3dcdf; } .ac-k-hu { background: #93d3a3; }

.ac-why { padding-left: 18px; margin: 0 0 6px; font-size: 13.5px; }
.ac-why li { margin-bottom: 5px; }
.ac-why small { color: #4a5a5f; }
.ac-gcount { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ac-gc { border-left: 4px solid #c5d0d3; background: #f7fafb; padding: 3px 8px; font-size: 13px; border-radius: 0 6px 6px 0; }
.ac-gc.ac-c-punct { border-left-color: #d48a00; }
.ac-glist { padding-left: 22px; font-size: 13.5px; max-height: 420px; overflow-y: auto; margin: 0; }
.ac-glist li { margin-bottom: 5px; }
.ac-st { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ac-st th, .ac-st td { border-bottom: 1px solid #e3eaec; padding: 5px 6px; text-align: left; vertical-align: top; }
.ac-st th { font-weight: 400; color: #4a5a5f; }
.ac-st small { color: #6b7b80; }
.ac-bars { display: block; width: 100%; height: 70px; background: #f7fafb; border: 1px solid #e3eaec; border-radius: 6px; }
.ac-2col .ac-bars { height: 160px; }
.ac-bars rect { fill: #1a6475; }

/* rule table */
.ac-tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 10px; }
.ac-rtable { border-collapse: collapse; width: 100%; font-size: 13.5px; background: #fff; min-width: 560px; }
.ac-rtable th, .ac-rtable td { border-bottom: 1px solid #e3eaec; padding: 6px 9px; text-align: left; vertical-align: top; }
.ac-rtable thead th { background: #1d3f4b; color: #fff; font-size: 12px; }
.ac-rtable tr.ac-tg th { background: #eef4f6; color: #1a3a40; font-size: 13px; }
.ac-rtable tr.ac-tg th span { font-weight: 400; color: #4a5a5f; }
.ac-rtable small { color: #4a5a5f; }
.ac-w { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.ac-wa { color: #b03a22; } .ac-wh { color: #1e6a34; }

@media (max-width: 900px) {
  .ac-tool, .ac-rgrid { grid-template-columns: minmax(0, 1fr); }
  .ac-incard .ac-text { flex: 0 0 auto; }
  .ac-text { min-height: 220px; }
}
@media print {
  .ac-tool, .ac-noprint, .ac-detail, #acChecks { display: none !important; }
  .ac-results { display: block !important; }
  .ac-out { max-height: none; overflow: visible; }
  .ac-rgrid { grid-template-columns: 1fr; }
}
