/* Hallucination Checker, Envie and Exnos inside the console.
   Loaded after /assets/assistant/assistant.css, so the page shell (top bar,
   "Console" heading, product tabs, footer) is identical to /console and the
   AI Assistant console. Only the checker's own parts are styled here, with
   the console's tokens. */

[hidden] { display: none !important; }
.console-user-email[hidden] { display: none !important; }

/* Subscribe / sign-in panel */
.ck-gate { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow-sm); }
.ck-gate h2 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; line-height: 1.25; margin: 0 0 0.6rem; }
.ck-gate p { color: var(--text-2); font-size: 0.92rem; line-height: 1.65; margin: 0 0 1rem; max-width: 60ch; }
.ck-points { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.ck-points li { position: relative; padding: 0.4rem 0 0.4rem 1.1rem; font-size: 0.88rem; color: var(--text); border-top: 1px solid var(--border); }
.ck-points li:last-child { border-bottom: 1px solid var(--border); }
.ck-points li::before { content: ''; position: absolute; left: 0; top: 0.95rem; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.ck-price { font-size: 0.9rem; color: var(--text-2); margin-bottom: 1rem; }
.ck-price strong { font-family: var(--display); font-weight: 400; font-size: 1.4rem; color: var(--text); }
.ck-error { margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--red); }

/* Workspace: documents on the left, the AI's text and results on the right */
.ck-work { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.ck-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.ck-docs { padding: 1.1rem; position: sticky; top: 1rem; }
.ck-panel-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 0.8rem; }
.upload-zone { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 1.25rem 0.75rem; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: var(--accent-veil); }
.upload-text { font-size: 0.88rem; font-weight: 500; color: var(--text); }
.upload-hint { font-size: 0.75rem; color: var(--text-3); margin-top: 0.15rem; }
.doc-list { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.8rem; }
.doc-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: border-color 0.15s; }
.doc-item:hover { border-color: var(--border-strong); }
.doc-icon svg { width: 16px; height: 16px; color: var(--text-3); display: block; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 0.82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-size { font-size: 0.72rem; color: var(--text-3); }
.doc-remove { border: none; background: transparent; color: var(--text-3); cursor: pointer; padding: 4px; border-radius: 6px; display: flex; }
.doc-remove:hover { background: var(--red-pale); color: var(--red); }
.doc-error { font-size: 0.75rem; color: var(--red); margin-top: 0.6rem; line-height: 1.45; }
.doc-count { margin-top: 0.9rem; font-size: 0.75rem; color: var(--text-3); }
.doc-meter { height: 3px; background: var(--border); border-radius: 2px; margin-top: 0.45rem; overflow: hidden; }
.doc-meter span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.doc-meter.full span { background: var(--red); }

.ck-check { padding: 1.25rem; }
.output-field { width: 100%; min-height: 320px; box-sizing: border-box; padding: 0.85rem 1rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-family: var(--sans); font-size: 0.92rem; line-height: 1.65; color: var(--text); resize: vertical; outline: none; }
.output-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-veil); }
.paste-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.85rem; }
.paste-info { font-size: 0.78rem; color: var(--text-3); }
.paste-info.over { color: var(--red); }

/* Results */
.result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.score { font-family: var(--display); font-size: 3rem; line-height: 1; }
.score-pct { font-size: 1.4rem; color: var(--text-3); margin-left: 0.15rem; }
.result-head.clean .score { color: var(--green); }
.result-head.mixed .score { color: var(--amber); }
.result-head.bad .score { color: var(--red); }
.score-line { margin-top: 0.45rem; font-size: 0.9rem; color: var(--text-2); }
.result-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.tally { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.9rem 0; }
.chip { font-size: 0.78rem; color: var(--text-2); padding: 0.25rem 0.6rem; border: 1px solid var(--border); border-radius: 999px; }
.chip b { font-weight: 600; color: var(--text); }
.chip.supported b { color: var(--green); }
.chip.unsupported b { color: var(--amber); }
.chip.contradicted b { color: var(--red); }
.only-problems { margin-left: auto; font-size: 0.78rem; color: var(--text-2); display: flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.result-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.result { border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--radius); padding: 0.75rem 0.9rem; }
.result.supported { border-left-color: var(--green); }
.result.unsupported, .result.unchecked { border-left-color: #D4A017; }
.result.contradicted { border-left-color: var(--red); }
.result.no_claim { opacity: 0.7; }
.result-top { display: flex; gap: 0.8rem; align-items: baseline; }
.badge { flex-shrink: 0; width: 10.5rem; font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.result.supported .badge { color: var(--green); }
.result.unsupported .badge, .result.unchecked .badge { color: var(--amber); }
.result.contradicted .badge { color: var(--red); }
.result-sentence { font-size: 0.9rem; line-height: 1.6; }
.result-quote { margin: 0.5rem 0 0 11.3rem; padding-left: 0.7rem; border-left: 2px solid var(--border-strong); font-size: 0.82rem; line-height: 1.6; color: var(--text-2); }
.result-why { margin: 0.35rem 0 0 11.3rem; font-size: 0.78rem; line-height: 1.5; color: var(--text-3); }
.result-empty { padding: 0.9rem; font-size: 0.88rem; color: var(--text-2); }
.result-foot { margin: 1.25rem 0 0; font-size: 0.76rem; line-height: 1.6; color: var(--text-3); }

/* Document viewer */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal-overlay.visible { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 720px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow-md); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-title { font-family: var(--display); font-size: 1.15rem; }
.modal-close { border: none; background: transparent; color: var(--text-3); cursor: pointer; padding: 6px; border-radius: 6px; display: flex; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.doc-modal-body { padding: 1.25rem; overflow-y: auto; font-size: 0.88rem; line-height: 1.75; white-space: pre-wrap; }

/* Install pages */
.install-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1.75rem 2rem; }
.install-card h2 { font-family: var(--display); font-weight: 400; font-size: 1.45rem; margin: 0 0 0.4rem; }
.install-lead { color: var(--text-2); font-size: 0.92rem; line-height: 1.65; margin: 0 0 1.25rem; }
.install-step { font-size: 0.92rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.install-text { font-size: 0.88rem; line-height: 1.65; color: var(--text-2); margin: 0 0 0.6rem; }
.install-text code { font-family: var(--mono); font-size: 0.85em; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }
.install-code { background: #111; color: #f2f2f2; border-radius: var(--radius); padding: 0.85rem 1rem; font-family: var(--mono); font-size: 0.82rem; line-height: 1.6; white-space: pre-wrap; word-break: break-all; margin: 0 0 0.6rem; user-select: all; }
.install-tag { display: inline-block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-text); background: var(--accent-pale); padding: 0.2rem 0.55rem; border-radius: 999px; margin-bottom: 0.8rem; }
.install-more { margin: 1.5rem 0 0; font-size: 0.85rem; }
.install-more a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 820px) {
  .ck-work { grid-template-columns: minmax(0, 1fr); }
  .ck-docs { position: static; }
  .result-head { flex-direction: column; align-items: flex-start; }
  .result-top { flex-direction: column; gap: 0.2rem; }
  .badge { width: auto; }
  .result-quote, .result-why { margin-left: 0; }
  .install-card { padding: 1.25rem; }
}
