/* TT-koll browser app — paste text, see live highlights.
   Lives at /check.html. Loads style.css first for shared primitives. */

.check-body {
  overflow-x: hidden;
}
.check-body html { scroll-snap-type: none; } /* disable section snap here */

.check-main {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(40px, 7vh, 80px) 32px clamp(60px, 10vh, 120px);
}

.check-head {
  text-align: center;
  margin-bottom: 36px;
}
.check-head .kicker {
  display: inline-block;
  padding: 4px 10px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.check-head h1 {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: 0.01em;
  line-height: 1;
  margin-bottom: 16px;
}
.check-lede {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ---------- Toolbar / stats above the editor ---------- */
.check-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--text);
  border-bottom: none;
  background: var(--card);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.check-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.check-stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10.5px;
}
.check-stat .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
}
.check-stat .dot-error { background: #cc2222; }
.check-stat .dot-warning { background: #f0c800; }
.check-stat#stat-error[data-count="0"],
.check-stat#stat-warning[data-count="0"] {
  opacity: 0.4;
}
.check-words {
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-left: 1px solid var(--border-strong);
  padding-left: 16px;
}
.check-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check-mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}
.check-mini-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--text);
  background: transparent;
  cursor: pointer;
  position: relative;
}
.check-mini-toggle input[type="checkbox"]:checked {
  background: var(--text);
}
.check-mini-toggle input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 2px;
  top: -1px;
  width: 5px;
  height: 9px;
  border: solid #f0c800;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check-mini-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
  border-radius: 0;
  padding: 6px 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.check-mini-btn:hover { background: var(--text); color: var(--bg); }

/* ---------- Editor ---------- */
.check-editor-wrap {
  border: 1px solid var(--text);
  background: var(--card);
  min-height: 56vh;
  display: flex;
  flex-direction: column;
}
.check-editor {
  flex: 1;
  padding: 24px 28px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  outline: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-height: 56vh;
  resize: vertical;
}
.check-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--dim);
  pointer-events: none;
}
.check-editor:focus { outline: none; }
.check-editor::selection { background: var(--text); color: var(--bg); }

/* Red = confirmed mistake; bold solid underline. */
.check-editor .mk {
  text-decoration: underline solid #cc2222;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: help;
}
/* Yellow = lower priority (kolla om du hinner). Dotted + thinner so it
   reads as a hint, not as an error. */
.check-editor .mk-warning {
  text-decoration: underline dotted #f0c800;
  text-decoration-thickness: 1px;
}

/* ---------- Status line ---------- */
.check-status {
  margin-top: 16px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--dim);
  min-height: 1.4em;
}

/* ---------- Tooltip (shared lookups; redeclared standalone) ---------- */
.tt-tooltip {
  position: fixed;
  z-index: 2147483647;
  max-width: 360px;
  min-width: 260px;
  padding: 14px 16px;
  background: #ffffff;
  color: #000000;
  border: 1px solid #000000;
  font-family: var(--f-sans);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
  text-align: left;
  color-scheme: light;
}
.tt-tooltip.is-on {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.tt-tip-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.tt-tip-sev { padding: 3px 7px; }
.tt-tip-sev-error { background: #cc2222; color: #fff; }
.tt-tip-sev-warning { background: #f0c800; color: #000; }
.tt-tip-meta { color: #555; }
.tt-tip-title {
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.tt-tip-swap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13px;
}
.tt-tip-wrong {
  font-family: ui-monospace, monospace;
  text-decoration: line-through;
  color: #cc2222;
}
.tt-tip-arrow { color: #888; }
.tt-tip-right {
  font-family: ui-monospace, monospace;
  background: #f0c800;
  padding: 1px 6px;
  color: #000;
}
.tt-tip-desc { color: #222; margin-bottom: 10px; }
.tt-tip-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tt-tip-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tt-tip-apply,
.tt-tip-dismiss,
.tt-tip-suppress {
  font-family: var(--f-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.tt-tip-apply {
  background: #000;
  color: #fff;
  border: 1px solid #000;
}
.tt-tip-apply:hover { background: #f0c800; color: #000; }
.tt-tip-dismiss,
.tt-tip-suppress {
  background: transparent;
  color: #222;
  border: 1px solid #d0d0d0;
}
.tt-tip-dismiss:hover,
.tt-tip-suppress:hover { border-color: #000; color: #000; }
.tt-tip-suppress { font-size: 11px; }
.tt-tip-link {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid #000;
  padding-bottom: 1px;
  white-space: nowrap;
}
.tt-tip-link:hover { color: #cc2222; border-color: #cc2222; }

@media (max-width: 720px) {
  .check-main { padding: 32px 18px 60px; }
  .check-bar { padding: 8px 10px; }
  .check-words { display: none; }
  .check-editor { padding: 18px 20px; font-size: 16px; }
}
