/* ===== PATTERNMATCH — GLOBAL STYLES ===== */

:root {
  --bg: #0e0e10;
  --bg2: #141416;
  --bg3: #1a1a1e;
  --bg4: #222228;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #f0f0f2;
  --text2: #9999aa;
  --text3: #666677;
  --red: #e24b4a;
  --red-bg: rgba(226,75,74,0.12);
  --amber: #ef9f27;
  --amber-bg: rgba(239,159,39,0.12);
  --purple: #7f77dd;
  --purple-bg: rgba(127,119,221,0.12);
  --pink: #d4537e;
  --pink-bg: rgba(212,83,126,0.12);
  --teal: #1d9e75;
  --teal-bg: rgba(29,158,117,0.12);
  --blue: #378add;
  --blue-bg: rgba(55,138,221,0.12);
  --green: #639922;
  --radius: 8px;
  --radius-lg: 12px;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* ===== NAV ===== */
nav {
  background: var(--bg2);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.nav-logo span { color: var(--red); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--text2);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
  font-family: var(--mono);
}

.nav-links a:hover, .nav-links a.active {
  background: var(--bg4);
  color: var(--text);
}

.nav-emergency {
  font-size: 12px;
  font-family: var(--mono);
  background: var(--red-bg);
  border: 0.5px solid rgba(226,75,74,0.3);
  color: var(--red);
  padding: 6px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
}

.nav-emergency:hover { background: rgba(226,75,74,0.2); }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
}

/* ===== PANELS ===== */
.panel {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.panel-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text3);
  margin-bottom: 12px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 16px;
  background: var(--bg3);
  border: 0.5px solid var(--border2);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  line-height: 1;
}

.btn:hover { background: var(--bg4); border-color: rgba(255,255,255,0.2); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-primary:hover { background: #c23d3c; border-color: #c23d3c; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg3); }

/* ===== BADGES ===== */
.badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  line-height: 1.6;
}

.badge-red { background: var(--red-bg); color: var(--red); border: 0.5px solid rgba(226,75,74,0.25); }
.badge-amber { background: var(--amber-bg); color: var(--amber); border: 0.5px solid rgba(239,159,39,0.25); }
.badge-purple { background: var(--purple-bg); color: var(--purple); border: 0.5px solid rgba(127,119,221,0.25); }
.badge-pink { background: var(--pink-bg); color: var(--pink); border: 0.5px solid rgba(212,83,126,0.25); }
.badge-teal { background: var(--teal-bg); color: var(--teal); border: 0.5px solid rgba(29,158,117,0.25); }
.badge-blue { background: var(--blue-bg); color: var(--blue); border: 0.5px solid rgba(55,138,221,0.25); }
.badge-gray { background: rgba(255,255,255,0.06); color: var(--text2); border: 0.5px solid var(--border); }

/* ===== SCORE BARS ===== */
.score-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.score-meta { display: flex; justify-content: space-between; font-size: 12px; }
.score-meta .lbl { color: var(--text2); font-family: var(--mono); }
.score-meta .val { font-family: var(--mono); font-weight: 500; }
.score-track { height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 2px; transition: width 0.7s cubic-bezier(.4,0,.2,1); width: 0%; }
.sf-red { background: var(--red); }
.sf-amber { background: var(--amber); }
.sf-purple { background: var(--purple); }
.sf-pink { background: var(--pink); }
.sf-blue { background: var(--blue); }

/* ===== FORMS ===== */
textarea, input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 0.5px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}

textarea:focus, input[type="text"]:focus {
  border-color: rgba(255,255,255,0.25);
}

textarea::placeholder, input::placeholder { color: var(--text3); }

/* ===== EMPTY STATES ===== */
.empty {
  text-align: center;
  color: var(--text3);
  font-family: var(--mono);
  font-size: 12px;
  padding: 24px 0;
}

/* ===== DIVIDERS ===== */
hr { border: none; border-top: 0.5px solid var(--border); margin: 24px 0; }

/* ===== ANNOTATIONS ===== */
.tok { border-radius: 3px; padding: 1px 2px; cursor: help; transition: opacity 0.15s; }
.tok:hover { opacity: 0.8; }
.tok-ultimatum   { background: rgba(226,75,74,0.18);  border-bottom: 2px solid var(--red); }
.tok-isolation   { background: rgba(239,159,39,0.15); border-bottom: 2px solid var(--amber); }
.tok-gaslighting { background: rgba(127,119,221,0.18);border-bottom: 2px solid var(--purple); }
.tok-blame_shift { background: rgba(212,83,126,0.18); border-bottom: 2px solid var(--pink); }
.tok-love_bombing{ background: rgba(29,158,117,0.15); border-bottom: 2px solid var(--teal); }
.tok-surveillance{ background: rgba(55,138,221,0.15); border-bottom: 2px solid var(--blue); }

/* ===== VERDICT BOX ===== */
.verdict {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  border-left: 3px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  line-height: 1.6;
}
.verdict.low    { border-color: var(--green);  background: rgba(99,153,34,0.08);  color: #8fc840; }
.verdict.medium { border-color: var(--amber);  background: var(--amber-bg);       color: var(--amber); }
.verdict.high   { border-color: var(--red);    background: var(--red-bg);         color: #f07070; }

/* ===== ACCORDION ===== */
.accordion-item {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 8px;
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  background: var(--bg2);
  transition: background 0.15s;
  user-select: none;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text);
}

.accordion-header:hover { background: var(--bg3); }
.accordion-header.open { background: var(--bg3); }

.accordion-header i { color: var(--text2); font-size: 18px; }
.accordion-title { flex: 1; font-size: 15px; font-weight: 500; }
.accordion-arrow { color: var(--text3); font-size: 16px; transition: transform 0.25s; }
.accordion-header.open .accordion-arrow { transform: rotate(180deg); }

.accordion-body {
  display: none;
  padding: 0 20px 20px;
  background: var(--bg2);
  border-top: 0.5px solid var(--border);
}

.accordion-body.open {
  display: block;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.article-section { margin-top: 18px; }
.article-section h4 { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 8px; font-family: var(--mono); }
.article-section p { font-size: 14px; color: var(--text2); line-height: 1.75; }

/* ===== CHECKLIST ===== */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
}
.checklist-item:last-child { border-bottom: none; }

.checklist-box {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.checklist-item.checked .checklist-box {
  background: var(--teal);
  border-color: var(--teal);
}

.checklist-item.checked .checklist-box::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
  display: block;
}

.checklist-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}

.checklist-item.checked .checklist-text {
  color: var(--text3);
  text-decoration: line-through;
}

/* ===== HOTLINE CARDS ===== */
.hotline-card {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hotline-name { font-size: 14px; font-weight: 500; color: var(--text); }
.hotline-desc { font-size: 12px; color: var(--text2); line-height: 1.6; }
.hotline-hours { font-size: 11px; font-family: var(--mono); color: var(--text3); }

.hotline-contact {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  background: var(--bg3);
  border-radius: var(--radius);
}

.hotline-contact a {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--teal);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hotline-contact a:hover { color: #2ec994; }

.hotline-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ===== PAGE HEADERS ===== */
.page-header {
  padding: 48px 0 36px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 36px;
}

.page-header .label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.page-header p {
  font-size: 15px;
  color: var(--text2);
  max-width: 580px;
  line-height: 1.7;
}

/* ===== FOOTER ===== */
footer {
  border-top: 0.5px solid var(--border);
  margin-top: 80px;
  padding: 32px 0;
  color: var(--text3);
  font-size: 12px;
  font-family: var(--mono);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-inner a { color: var(--text3); text-decoration: none; }
.footer-inner a:hover { color: var(--text2); }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg2);
    border-bottom: 0.5px solid var(--border);
    padding: 12px;
    gap: 4px;
    z-index: 99;
  }
  .nav-hamburger { display: block; }
  .page-header h1 { font-size: 22px; }
  .container, .container-sm { padding: 0 16px; }
}

/* ===== PROSE ===== */
.prose h2 { font-size: 20px; font-weight: 500; margin: 32px 0 12px; color: var(--text); }
.prose h3 { font-size: 16px; font-weight: 500; margin: 24px 0 8px; color: var(--text); font-family: var(--mono); }
.prose p  { color: var(--text2); margin-bottom: 16px; line-height: 1.8; }
.prose ul { color: var(--text2); padding-left: 20px; margin-bottom: 16px; }
.prose li { margin-bottom: 6px; line-height: 1.75; }

/* ===== TOOLTIP ===== */
.tooltip-wrap { position: relative; display: inline-block; }
.tooltip-box {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg4);
  border: 0.5px solid var(--border2);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text);
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
}
.tooltip-wrap:hover .tooltip-box { display: block; }

/* ===== TAB NAV ===== */
.tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text3);
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text2); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--red); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== CRISIS BANNER ===== */
.crisis-banner {
  background: rgba(226,75,74,0.08);
  border: 0.5px solid rgba(226,75,74,0.25);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 28px;
}

.crisis-banner i { color: var(--red); font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.crisis-banner-text { font-size: 13px; color: var(--text2); line-height: 1.6; }
.crisis-banner-text strong { color: var(--text); }
.crisis-banner-text a { color: var(--red); font-weight: 500; }

/* ===== Weight-modifier annotation styles (v1.1) ===== */
/* tok-amplified: negation masking detected — brighter underline, subtle pulse */
.tok-amplified {
  outline: 1px solid rgba(255,255,255,0.15);
  border-bottom-width: 3px !important;
  animation: tok-pulse 2.2s ease-in-out infinite;
}

@keyframes tok-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* tok-muted: suppressive negation — de-emphasized, dotted underline */
.tok-muted {
  opacity: 0.55;
  border-bottom-style: dotted !important;
}
