/* AI Control Check page. Loads after design-system.css and home.css and reuses their tokens. */
.ac-page .ts-hero { padding: 64px 0 72px; }
.ac-page .ts-hero h1 { font-size: clamp(34px, 5.4vw, 64px); hyphens: auto; overflow-wrap: break-word; }
.ac-page .ts-hero .ts-fine { color: #fff; }
.ac-page .ts-res-grid > * { min-width: 0; }
.ac-intro { max-width: 62ch; }
.ac-mono { font-family: var(--font-mono); font-size: 13px; }

/* Score bars: one row per area. --score (0 to 100) sets the fill. */
.ac-bars { display: grid; margin: 0; padding: 0; list-style: none; }
.ac-bars li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 3ch; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.ac-bar { position: relative; height: 6px; overflow: hidden; border-radius: 3px; background: var(--border); }
.ac-bar::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--accent); transform: scaleX(calc(var(--score) / 100)); transform-origin: left; }
.ac-bars .ac-mono { text-align: right; }

/* Example result in the hero: a light card, rows focus in one by one. */
.ac-example { margin: 0; }
.ac-example-card { padding: 22px; border-radius: var(--radius-card); background: #fff; color: var(--ink); box-shadow: 0 24px 60px #00000040; }
.ac-example-head, .ac-example-foot { display: flex; justify-content: space-between; gap: 12px; margin: 0; font-size: 14px; font-weight: 600; color: #5b6478; }
.ac-example-head { margin-bottom: 6px; }
.ac-example-foot { margin-top: 14px; color: var(--ink); }
.ac-example .ac-bars li { border-color: #e1e3e8; font-size: 15px; animation: ac-row-in 1s var(--ease-out) calc(.5s + var(--i, 0) * .12s) both; }
.ac-example .ac-bar { background: #e1e3e8; }
.ac-example .ac-bar::after { background: #2457ff; }
.ac-example .ac-bars li:nth-child(2) { --i: 1; }
.ac-example .ac-bars li:nth-child(3) { --i: 2; }
.ac-example .ac-bars li:nth-child(4) { --i: 3; }
.ac-example .ac-bars li:nth-child(5) { --i: 4; }
.ac-example .ac-bars li:nth-child(6) { --i: 5; }
@keyframes ac-row-in { from { opacity: 0; filter: blur(6px); transform: translateY(12px); } }

/* Questions: areas are headed groups on the page, only the answers are framed. */
.ac-progress { position: sticky; top: 72px; z-index: 5; display: flex; align-items: center; gap: 16px; margin: 32px 0 0; padding: 14px 0; background: var(--bg-primary); }
.ac-progress-line { position: relative; flex: 1; height: 2px; background: var(--border); }
.ac-progress-fill { position: absolute; inset: 0; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .9s var(--ease-out); }
.ac-progress .ac-mono { color: var(--text-muted); white-space: nowrap; }
.ac-area { max-width: 760px; margin-top: 48px; }
.ac-area-title { display: flex; align-items: baseline; gap: 14px; margin: 0; padding-bottom: 12px; border-bottom: 2px solid var(--text-primary); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.ac-num { font: 500 13px/1 var(--font-mono); color: var(--accent); }
.ac-q { margin: 28px 0 0; padding: 0; border: 0; }
.ac-q legend { margin-bottom: 14px; padding: 0; font-size: 18px; font-weight: 600; line-height: 1.45; }
.ac-opt { display: flex; align-items: center; gap: 14px; min-height: 52px; margin-top: 8px; padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-elevated); color: var(--text-primary); font-size: 16px; line-height: 1.45; cursor: pointer; transition: border-color .3s var(--ease-soft), background-color .3s var(--ease-soft); }
.ac-opt:hover { border-color: var(--accent); }
.ac-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-muted); }
.ac-opt input[type=radio] { flex: none; display: grid; place-content: center; width: 20px; height: 20px; margin: 0; border: 2px solid var(--border-strong); border-radius: 50%; background: var(--bg-elevated); appearance: none; cursor: pointer; }
.ac-opt input[type=radio]::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .4s var(--ease-out); }
.ac-opt input[type=radio]:checked { border-color: var(--accent); }
.ac-opt input[type=radio]:checked::before { transform: scale(1); }
.ac-opt input[type=radio]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.ac-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 48px; }
.ac-submit .ts-fine { margin: 0; }

/* Result: the score, a bar per area and where to start. */
.ac-result h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; outline: none; }
.ac-score { font-size: clamp(56px, 9vw, 96px); font-weight: 800; line-height: 1; letter-spacing: -.045em; }
.ac-score-of { font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--text-muted); }
.ac-band { flex-basis: 100%; font-size: clamp(26px, 3.4vw, 36px); }
.ac-result-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; margin-top: 40px; }
.ac-bars-result { margin-top: 16px; border-top: 1px solid var(--border); }
.ac-bars-result li > span:first-child { color: var(--text-secondary); }
.ac-bars-result .ac-bar::after { transform: scaleX(0); transition: transform 1.2s var(--ease-out) calc(.2s + var(--i, 0) * .1s); }
.ac-result.is-shown .ac-bars-result .ac-bar::after { transform: scaleX(calc(var(--score) / 100)); }
.ac-weak { display: grid; margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.ac-weak li { padding: 18px 0; border-bottom: 1px solid var(--border); }
.ac-weak-head { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; font-weight: 700; }
.ac-weak-head .ac-mono { color: var(--text-muted); font-weight: 500; }
.ac-weak p:last-child { margin: 0; color: var(--text-secondary); line-height: 1.6; }
.ac-none { margin: 16px 0 0; color: var(--text-secondary); }
.ac-send { max-width: 640px; margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--border); }
.ac-send > p:first-of-type { margin: 0; color: var(--text-secondary); }
.ac-again { min-height: 44px; margin-top: 32px; padding: 0; border: 0; background: none; color: var(--accent); font: 600 16px/1.4 var(--font-display); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.ac-again:hover { color: var(--accent-dark); text-decoration-thickness: 2px; }

.ac-page .ts-res-author { grid-template-columns: 96px minmax(0, 1fr); }
.ac-page .ts-res-author p { margin: 0; }

@media (max-width: 900px) {
  .ac-example { max-width: 520px; }
  .ac-result-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 640px) {
  .ac-example-card { padding: 16px; }
  .ac-bars li { grid-template-columns: minmax(0, 1fr) 72px 3ch; }
  .ac-q legend { font-size: 17px; }
  .ac-page .ts-res-author { grid-template-columns: 72px minmax(0, 1fr); }
}
