:root {
  --cream: #f5f0e8;
  --warm-white: #faf8f4;
  --ink: #1a1612;
  --ink-soft: #3d3530;
  --accent: #c4723a;
  --accent-light: #e8c4a0;
  --accent-muted: #f0e0cc;
  --border: #ddd5c8;
  --green: #3a6b4a;
  --red: #8b2e2e;

  /* Layout tokens */
  --content-max: 900px;
  --px: clamp(1.25rem, 5vw, 4rem);
  --section-gap: clamp(3rem, 6vw, 5rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  background: var(--warm-white);
  color: var(--ink);
  line-height: 1.8;
  font-size: clamp(16px, 1.8vw, 19px);
}

/* ── HEADER ── */
.site-header {
  background: var(--ink);
  padding: 16px var(--px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.site-logo {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--cream); letter-spacing: .06em; text-decoration: none;
}
.site-logo span { color: var(--accent-light); }
.header-tag {
  font-size: clamp(.65rem, 1.2vw, .75rem);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-light); opacity: .7;
}

/* ── OFFICIAL BAR ── */
.official-bar {
  background: var(--green);
  color: #fff;
  text-align: center;
  padding: 10px var(--px);
  font-size: clamp(.78rem, 1.3vw, .88rem);
  letter-spacing: .03em;
  line-height: 1.5;
}
.official-bar a { color: #b8f0cc; text-decoration: underline; }

/* ── HERO ── */
.hero {
  background: var(--ink);
  padding: clamp(3rem, 8vw, 6rem) var(--px) clamp(3rem, 6vw, 5rem);
  position: relative; overflow: hidden;
}
.hero::before {
  content: 'TR';
  position: absolute; right: -20px; top: -30px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(10rem, 22vw, 22rem); font-weight: 700;
  color: rgba(196,114,58,.06); line-height: 1;
  pointer-events: none; user-select: none;
}
.hero-inner { max-width: var(--content-max); margin: 0 auto; position: relative; }

.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: clamp(.68rem, 1.1vw, .78rem);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-light);
  border: 1px solid rgba(196,114,58,.4);
  padding: 5px 14px; border-radius: 2px; margin-bottom: clamp(1.25rem, 3vw, 2rem);
}
.hero-kicker .live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #4caf80;
  animation: pulse 1.8s infinite; flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 4.5vw, 3.4rem);
  font-weight: 700; color: var(--cream);
  line-height: 1.2; margin-bottom: clamp(1rem, 2vw, 1.5rem);
}
.hero h1 em { font-style: italic; color: var(--accent-light); }

.hero-meta {
  font-size: clamp(.78rem, 1.2vw, .88rem);
  color: rgba(245,240,232,.45); letter-spacing: .04em;
  display: flex; flex-wrap: wrap; gap: 4px 16px;
}
.hero-meta span::before { content: '· '; }
.hero-meta span:first-child::before { content: ''; }

.hero-lead {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  font-size: clamp(.95rem, 1.6vw, 1.1rem);
  color: rgba(245,240,232,.78); line-height: 1.85;
  border-left: 3px solid var(--accent); padding-left: 1.25rem;
}

/* ── TOC ── */
.toc-wrap { background: var(--cream); border-bottom: 1px solid var(--border); }
.toc-inner { max-width: var(--content-max); margin: 0 auto; padding: clamp(1.5rem, 4vw, 2.5rem) var(--px); }
.toc-label {
  font-size: .7rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem; font-weight: 500;
}
.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 4px 2rem;
}
.toc-grid a {
  font-size: clamp(.82rem, 1.3vw, .92rem);
  color: var(--ink-soft); text-decoration: none;
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.toc-grid a:hover { color: var(--accent); border-bottom-color: var(--accent-light); }
.toc-num { font-size: .68rem; font-weight: 500; color: var(--accent); min-width: 20px; flex-shrink: 0; }

/* ── ARTICLE BODY ── */
.article-body {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--section-gap) var(--px) calc(var(--section-gap) * 1.5);
}
.section { margin-bottom: var(--section-gap); }

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  font-weight: 700; color: var(--ink);
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
  padding-bottom: .875rem;
  border-bottom: 2px solid var(--accent);
  display: flex; align-items: baseline; gap: .875rem;
  line-height: 1.25;
}
.section-num {
  font-size: .75rem; letter-spacing: .15em; color: var(--accent);
  font-family: 'DM Sans', sans-serif; font-weight: 500;
  flex-shrink: 0;
}

.subsection { margin: clamp(1.5rem, 3vw, 2.25rem) 0; }
.subsection-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  font-weight: 600; color: var(--ink); margin-bottom: .75rem;
  line-height: 1.3;
}

p { margin-bottom: 1rem; color: var(--ink-soft); }
strong { font-weight: 500; color: var(--ink); }

/* ── TABLES ── */
.table-wrap {
  overflow-x: auto; margin: 1.5rem 0;
  border-radius: 6px; border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: clamp(.84rem, 1.3vw, .95rem); }
thead tr { background: var(--ink); }
thead th {
  color: var(--cream); font-weight: 500;
  font-size: clamp(.72rem, 1.1vw, .8rem);
  letter-spacing: .06em; text-transform: uppercase;
  padding: .875rem 1rem; text-align: left;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:hover { background: var(--accent-muted); }
tbody td { padding: .75rem 1rem; color: var(--ink-soft); line-height: 1.55; vertical-align: top; }
tbody td:first-child { color: var(--ink); }
.ok { color: var(--green); font-weight: 500; white-space: nowrap; }
.no { color: var(--red); font-weight: 500; white-space: nowrap; }
.highlight-row td { background: rgba(196,114,58,.07); }
.highlight-row td:first-child { font-weight: 600; color: var(--accent); }

/* ── CALLOUTS & LECTURE STYLES ── */
.callout {
  border-left: 4px solid var(--accent); background: var(--accent-muted);
  padding: 1rem 1.25rem; margin: 1.5rem 0; border-radius: 0 6px 6px 0;
}
.callout p { color: var(--ink-soft); margin: 0; font-size: clamp(.9rem, 1.4vw, 1rem); line-height: 1.7; }
.callout.warning { border-left-color: var(--red); background: #fdf0f0; }
.callout.warning p { color: #5a2020; }
.callout.success { border-left-color: var(--green); background: #edf5f0; }
.callout.success p { color: #1e3d2a; }

.law-cite {
  background: rgba(26,22,18,.04); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  padding: .875rem 1.25rem; font-size: clamp(.82rem, 1.3vw, .92rem); color: var(--ink-soft); font-style: italic;
  margin: 1rem 0 1.25rem; border-radius: 0 4px 4px 0; line-height: 1.7;
}
.law-cite strong { font-style: normal; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.source-tag { font-size: clamp(.72rem, 1.1vw, .8rem); color: #999; font-style: italic; margin-top: .5rem; margin-bottom: 1.25rem; }

ul.content-list { list-style: none; margin: 1rem 0 1.5rem; padding: 0; }
ul.content-list li {
  padding: .6rem 0 .6rem 1.5rem; position: relative; color: var(--ink-soft);
  font-size: clamp(.9rem, 1.4vw, 1rem); border-bottom: 1px solid var(--border); line-height: 1.65;
}
ul.content-list li::before { content: '—'; position: absolute; left: 0; color: var(--accent); font-weight: 500; }

/* ── PROMO BANNER & CONVERSION BOXEN ── */
.promo-banner { background: var(--cream); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 4px; padding: 1.5rem 2rem; margin-bottom: var(--section-gap); }
.promo-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 700; color: var(--ink); margin-bottom: 0.5rem; }
.promo-text { font-size: 0.95rem; margin-bottom: 1.25rem; color: var(--ink-soft); }
.btn-primary { background: var(--accent); color: white; border: none; padding: 10px 20px; font-family: 'DM Sans', sans-serif; font-size: 0.8rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; border-radius: 2px; cursor: pointer; transition: background 0.2s; }
.btn-primary:hover { background: var(--ink); }

.service-box { border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--cream); margin-top: 32px; padding: 2rem; border-radius: 4px; }
.service-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 700; color: var(--ink); margin-bottom: 0.5rem; }
.service-text { font-size: 0.95rem; margin-bottom: 1.25rem; color: var(--ink-soft); line-height: 1.7; }
.service-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-dark { background: var(--ink); color: var(--cream); padding: 12px 24px; font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 500; text-decoration: none; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 2px; transition: background 0.2s; }
.btn-dark:hover { background: var(--accent); }
.service-subtext { font-size: 0.85rem; color: var(--ink-soft); }

/* ── FAZIT CARDS ── */
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.5rem; }
@media(max-width:640px){ .cards-grid { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem 1.5rem; background: var(--cream); }
.card.pro { border-top: 3px solid var(--green); }
.card.con { border-top: 3px solid var(--red); }
.card-title { font-size: clamp(.68rem, 1vw, .75rem); letter-spacing: .18em; text-transform: uppercase; font-weight: 500; margin-bottom: 1rem; }
.card.pro .card-title { color: var(--green); }
.card.con .card-title { color: var(--red); }
.card ul { list-style: none; padding: 0; }
.card ul li { font-size: clamp(.86rem, 1.3vw, .95rem); color: var(--ink-soft); padding: .4rem 0; border-bottom: 1px solid var(--border); display: flex; gap: .625rem; align-items: baseline; line-height: 1.55; }
.card ul li .bullet { flex-shrink: 0; font-size: .85rem; }
.card.pro .bullet { color: var(--green); }
.card.con .bullet { color: var(--red); }

/* ── SOURCES & FOOTER ── */
.sources-section { background: var(--cream); border-top: 1px solid var(--border); padding: clamp(2rem, 5vw, 3rem) var(--px); }
.sources-inner { max-width: var(--content-max); margin: 0 auto; }
.sources-label { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 1.25rem; }
.sources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 6px 2rem; }
.sources-grid li { font-size: clamp(.78rem, 1.2vw, .86rem); color: var(--ink-soft); list-style: none; padding: .35rem 0; border-bottom: 1px solid var(--border); line-height: 1.5; }
.sources-grid a { color: var(--accent); word-break: break-all; }
.disclaimer { max-width: var(--content-max); margin: 0 auto; padding: 1.75rem var(--px) 0; font-size: clamp(.74rem, 1.1vw, .82rem); color: #aaa; font-style: italic; line-height: 1.7; }
.site-footer { background: var(--ink); color: rgba(245,240,232,.4); text-align: center; padding: 1.75rem var(--px); font-size: clamp(.75rem, 1.1vw, .82rem); margin-top: clamp(2rem, 5vw, 4rem); letter-spacing: .04em; }
.site-footer a { color: var(--accent-light); text-decoration: none; }

/* ── FX ── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .55s ease, transform .55s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── NATIVE CHATBOT PLATFORM WIDGETS ── */
.chat-tooltip {
  position: fixed; bottom: 28px; right: 95px; z-index: 9998;
  background: var(--ink); color: var(--cream);
  padding: 10px 16px; border-radius: 6px; font-size: 13px; font-weight: 400;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15); border: 1px solid var(--accent);
  white-space: nowrap; pointer-events: none;
  animation: tooltipFloat 2s infinite ease-in-out;
}
.chat-tooltip::after {
  content: ''; position: absolute; right: -6px; top: 50%; transform: translateY(-50%) rotate(45deg);
  width: 10px; height: 10px; background: var(--ink); border-right: 1px solid var(--accent); border-top: 1px solid var(--accent);
}
@keyframes tooltipFloat { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-6px); } }

#ai-chat-button {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  background: var(--accent); color: var(--cream);
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 6px 20px rgba(196,114,58,0.3);
  font-size: 24px; transition: transform 0.2s, background 0.2s;
}

#ai-chat-window {
  position: fixed; bottom: 95px; right: 20px; z-index: 9999;
  width: 400px; height: 550px; background: var(--warm-white);
  border-radius: 8px; box-shadow: 0 12px 40px rgba(26,22,18,0.15);
  display: none; flex-direction: column; overflow: hidden;
  font-family: 'DM Sans', sans-serif; border: 1px solid var(--border);
}

.chat-header { background: var(--ink); color: var(--cream); padding: 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--accent); }
.chat-title { margin: 0; font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 700; letter-spacing: 0.03em; }
.chat-subtitle { margin: 2px 0 0 0; font-size: 11px; color: rgba(245,240,232,0.6); font-weight: 400; }
.chat-close { cursor: pointer; font-size: 24px; color: rgba(245,240,232,0.6); line-height: 1; }

#chat-box { flex: 1; padding: 20px; overflow-y: auto; background: var(--warm-white); font-size: 14px; display: flex; flex-direction: column; gap: 14px; }
.chat-msg { padding: 12px 16px; border-radius: 4px; max-width: 85%; line-height: 1.5; }
.system-msg { background: var(--cream); color: var(--ink); border: 1px solid var(--border); }
.user-msg { background: var(--ink); color: var(--cream); align-self: flex-end; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.reply-msg { background: white; border: 1px solid var(--border); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.error-msg { background: #fdf0f0; border: 1px solid var(--red); color: var(--red); font-size: 13px; }

.chat-form { padding: 12px; border-top: 1px solid var(--border); display: flex; background: white; margin: 0; }
.chat-form input { flex: 1; padding: 12px; border: 1px solid var(--border); border-radius: 2px; font-family: 'DM Sans', sans-serif; font-size: 13px; outline: none; color: var(--ink); background: var(--warm-white); }
.chat-form button { background: var(--ink); color: var(--cream); border: none; padding: 0 20px; margin-left: 8px; border-radius: 2px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.2s; }

.custom-scrollbar::-webkit-scrollbar { width: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: var(--warm-white); }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }