/* =============================================
   IA Prática para Advogados — Brutalist Legal
   ============================================= */

:root {
  /* Core palette */
  --cream:    #f2ede4;
  --cream-d:  #e8e2d8;
  --cream-dd: #d8d2c8;
  --black:    #0d0d0d;
  --black-2:  #111111;
  --black-3:  #1a1a1a;
  --black-4:  #2e2e2e;
  --red:      #e63012;
  --red-d:    #c5240a;
  --red-bg:   rgba(230,48,18,0.07);

  /* Semantic aliases */
  --bg:          var(--cream);
  --bg-dark:     var(--cream-d);
  --surface:     #ffffff;
  --text:        var(--black);
  --text-light:  #333333;
  --text-muted:  #666666;
  --text-subtle: #999999;
  --border:      var(--black);
  --border-soft: var(--cream-dd);

  /* Semantic colors */
  --success:        #1b5e20;
  --success-bg:     #e6f4ea;
  --success-border: #a5d6a7;
  --warning:        #bf360c;
  --warning-bg:     #fbe9e7;
  --warning-border: #ffab91;
  --danger:         #b71c1c;
  --danger-bg:      #fde8e8;
  --danger-border:  #ef9a9a;
  --info:           #0d47a1;
  --info-bg:        #e8eaf6;
  --info-border:    #9fa8da;

  /* Code */
  --code-bg:   #0d0d0d;
  --code-head: #111111;
  --code-text: #cdd3de;

  /* Fonts */
  --f-display: 'Barlow Condensed', sans-serif;
  --f-mono:    'JetBrains Mono', monospace;
  --f-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --sidebar-w: 244px;
  --header-h:  50px;
  --footer-h:  58px;

  /* Borders — brutalist, no radius */
  --b-heavy: 2px solid var(--black);
  --b-med:   1.5px solid var(--black);
  --b-soft:  1px solid var(--border-soft);
  --b-red:   2px solid var(--red);
}

/* ─── Reset ──────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--red); color: #fff; }

/* ─── Scrollbar ───────────────────────────── */
::-webkit-scrollbar            { width: 4px; height: 4px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: var(--black-4); }
::-webkit-scrollbar-thumb:hover{ background: var(--black); }

/* ─── App shell ───────────────────────────── */
.app { display:flex; min-height:100vh; }

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--black-2);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top:0; left:0; bottom:0;
  z-index: 100;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  border-right: var(--b-heavy);
}

/* Header */
.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1.5px solid var(--black-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.logo-name {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1;
}
.logo-sub {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--red);
  letter-spacing: 1px;
  margin-top: 4px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
}
.sidebar-toggle span {
  width: 18px; height: 1.5px;
  background: rgba(255,255,255,.7);
  display: block;
}

/* Nav */
.sidebar-nav { flex:1; padding: 12px 0; overflow-y:auto; }
.nav-section  { margin-bottom: 16px; }
.nav-section-resources { margin-top: 4px; }

.nav-label {
  display: block;
  padding: 0 18px 6px;
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--black-4);
  letter-spacing: 1px;
}

.sidebar-nav ul { list-style: none; }
.sidebar-nav li { margin: 1px 0; }

/* Module nav items */
.sidebar-nav > .nav-section:first-child a,
.sidebar-nav a[data-index] {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--black-4);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .15s;
}
.sidebar-nav a[data-index]:hover { color: #aaa; background: rgba(255,255,255,.03); }
.sidebar-nav a[data-index].active {
  color: var(--red);
  border-left-color: var(--red);
  background: var(--red-bg);
}
.sidebar-nav a[data-index].completed { color: var(--black-4); }
.sidebar-nav a[data-index].completed .nav-num { color: #3a3; }

.nav-num {
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--black-4);
  width: 20px;
  flex-shrink: 0;
  text-align: right;
}
.sidebar-nav a[data-index].active .nav-num { color: var(--red); }
.nav-title { flex:1; }

/* Resources links */
.sidebar-nav-link {
  display: block;
  padding: 6px 18px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--black-4);
  text-decoration: none;
  transition: color .15s;
}
.sidebar-nav-link:hover { color: #888; }

/* Progress footer */
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1.5px solid var(--black-4);
  flex-shrink: 0;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.progress-meta-label {
  font-family: var(--f-mono);
  font-size: 8px;
  color: var(--black-4);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.progress-pct {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
}
.progress-bar {
  height: 2px;
  background: var(--black-4);
}
.progress-fill {
  height: 100%;
  background: var(--red);
  transition: width .6s cubic-bezier(.4,0,.2,1);
  width: 0%;
}
.progress-text {
  font-family: var(--f-mono);
  font-size: 8px;
  color: var(--black-4);
  margin-top: 6px;
  display: block;
}

/* ═══════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.content-header {
  height: var(--header-h);
  background: var(--cream);
  border-bottom: var(--b-heavy);
  display: flex;
  align-items: center;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-btn {
  display: none;
  background: none;
  border: var(--b-med);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 10px;
  margin-right: 14px;
  color: var(--text);
  font-family: var(--f-mono);
  line-height: 1.3;
  transition: all .15s;
}
.menu-btn:hover { background: var(--black); color: #fff; }

.breadcrumb {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--black-4);
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb-sep { color: var(--red); font-weight: 700; }
.breadcrumb span { color: var(--black); font-weight: 700; }

/* Body */
.content-body {
  flex: 1;
  padding: 40px 48px;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

/* Footer */
.content-footer {
  height: var(--footer-h);
  background: var(--cream);
  border-top: var(--b-heavy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  bottom: 0;
}

/* ═══════════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════════ */
.content-body h1 {
  font-family: var(--f-display);
  font-size: 54px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--black);
  line-height: .9;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.content-body h1 em {
  color: var(--red);
  font-style: normal;
  display: block;
}

.content-body h2 {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--black);
  margin-top: 40px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: var(--b-heavy);
  display: flex;
  align-items: center;
  gap: 10px;
}
.content-body h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--red);
  flex-shrink: 0;
}

.content-body h3 {
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--black);
  margin-top: 28px;
  margin-bottom: 10px;
}

.content-body h4 {
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--black);
  margin-top: 20px;
  margin-bottom: 8px;
}

.content-body p {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.72;
  margin-bottom: 16px;
}
.content-body strong { color: var(--black); font-weight: 700; }

/* ─── Lists ───────────────────────────────── */
.content-body ul,
.content-body ol {
  margin-bottom: 20px;
  padding-left: 22px;
}
.content-body li {
  margin-bottom: 8px;
  color: var(--text-light);
  font-size: 15px;
  line-height: 1.65;
}
.content-body ul ul,
.content-body ol ol { margin-top: 8px; margin-bottom: 8px; }

/* ─── Inline code ─────────────────────────── */
.content-body code {
  font-family: var(--f-mono);
  font-size: .8em;
  background: var(--cream-d);
  padding: 2px 6px;
  border: 1px solid var(--cream-dd);
  color: #b5370d;
  font-weight: 500;
}

/* ─── Code blocks ─────────────────────────── */
.content-body pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 0;
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.68;
  border: none;
}
.content-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border: none;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--code-head);
  color: #666;
  padding: 9px 14px 9px 50px;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  border-bottom: 1.5px solid var(--black-4);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.code-header::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px;
  background: #ff5f57;
  box-shadow: 15px 0 0 #febc2e, 30px 0 0 #28c840;
}

.code-block {
  margin-bottom: 22px;
  border: var(--b-heavy);
}
.code-block pre { margin: 0; }

.copy-btn {
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #444;
  background: none;
  border: 1px solid #333;
  padding: 3px 10px;
  cursor: pointer;
  transition: all .15s;
}
.copy-btn:hover { color: #ccc; border-color: #666; }

/* ─── Cards ───────────────────────────────── */
.card {
  background: var(--surface);
  border: var(--b-med);
  border-left: 4px solid var(--black);
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: border-left-color .2s;
}
.card:hover { border-left-color: var(--red); }
.card h3 {
  font-family: var(--f-display);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--black);
  margin-top: 0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3 img { flex-shrink:0; }
.card p { font-size: 14px; margin-bottom: 0; color: var(--text-muted); }

/* ─── Alert boxes ─────────────────────────── */
.info-box, .warning-box, .success-box, .danger-box {
  padding: 13px 16px 13px 52px;
  margin-bottom: 20px;
  position: relative;
  font-size: 14px;
  line-height: 1.6;
  border-left: 4px solid;
}
.info-box::before, .warning-box::before,
.success-box::before, .danger-box::before {
  font-family: var(--f-mono);
  position: absolute;
  left: 14px;
  top: 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}
.info-box    { background: var(--info-bg);    border-color: var(--info);    color: #1a237e; }
.info-box::before    { content: '[i]'; color: var(--info); }
.warning-box { background: var(--warning-bg); border-color: var(--warning); color: #bf360c; }
.warning-box::before { content: '[!]'; color: var(--warning); }
.success-box { background: var(--success-bg); border-color: var(--success); color: #1b5e20; }
.success-box::before { content: '[✓]'; color: var(--success); }
.danger-box  { background: var(--danger-bg);  border-color: var(--danger);  color: #b71c1c; }
.danger-box::before  { content: '[✗]'; color: var(--danger); }
.info-box p:last-child, .warning-box p:last-child,
.success-box p:last-child, .danger-box p:last-child {
  margin-bottom: 0; color: inherit;
}

/* ─── Buttons ─────────────────────────────── */
.btn-nav {
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 10px 22px;
  border: var(--b-med);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.btn-nav:hover:not(:disabled) {
  border-color: var(--black);
  color: var(--black);
  background: var(--cream-d);
}
.btn-nav:disabled { opacity: .35; cursor: not-allowed; }

.btn-next, #nextBtn {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-next:hover:not(:disabled), #nextBtn:hover:not(:disabled) {
  background: var(--red-d);
  border-color: var(--red-d);
  color: #fff;
}

.btn-primary {
  display: inline-block;
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 11px 24px;
  background: var(--black);
  color: #fff;
  text-decoration: none;
  border: var(--b-heavy);
  cursor: pointer;
  transition: all .15s;
}
.btn-primary:hover { background: var(--red); border-color: var(--red); }

/* ─── Tables ──────────────────────────────── */
.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 22px;
  font-size: 14px;
  border: var(--b-heavy);
}
.content-body th {
  background: var(--black);
  padding: 10px 14px;
  text-align: left;
  font-family: var(--f-display);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  border-bottom: var(--b-heavy);
}
.content-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--cream-d);
  color: var(--text-light);
  font-size: 14px;
  vertical-align: middle;
}
.content-body td img { vertical-align: middle; margin-right: 6px; }
.content-body tr:last-child td { border-bottom: none; }
.content-body tr:hover td { background: var(--cream-d); }

/* ─── Checklist ───────────────────────────── */
.checklist { list-style: none !important; padding-left: 0 !important; }
.checklist li {
  position: relative;
  padding: 10px 14px 10px 44px;
  margin-bottom: 6px;
  background: var(--surface);
  border: var(--b-soft);
  border-left: var(--b-med);
  font-size: 14px;
  color: var(--text-light);
  transition: all .15s;
}
.checklist li:hover { border-left-color: var(--red); }
.checklist li::before {
  font-family: var(--f-mono);
  content: '○';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cream-dd);
  font-size: 14px;
}
.checklist li.checked::before { content: '●'; color: var(--success); }

/* ─── Tabs ────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: var(--b-heavy);
  margin-bottom: 24px;
}
.tab-btn {
  font-family: var(--f-display);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 10px 18px;
  background: var(--cream-d);
  border: none;
  border-right: 1px solid var(--cream-dd);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tab-btn img { flex-shrink:0; }
.tab-btn:hover  { background: var(--cream-dd); color: var(--black); }
.tab-btn.active {
  background: var(--black);
  color: #fff;
  border-right-color: transparent;
}
.tab-btn.active img { filter: invert(1); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Video placeholder ───────────────────── */
.video-placeholder {
  border: var(--b-heavy);
  height: 290px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  color: #fff;
  background: #0d0d0d;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
/* gradient fade to black at bottom (over mockup) */
.video-placeholder::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(to bottom, transparent, rgba(10,10,10,.92));
  z-index: 2;
  pointer-events: none;
}
/* bottom info strip */
.vp-info {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px 16px;
}
.vp-info h3 {
  font-family: var(--f-display);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  margin: 0 0 2px;
}
.vp-info p {
  font-family: var(--f-mono);
  color: rgba(255,255,255,.5);
  font-size: 10px;
  letter-spacing: .5px;
  margin: 0;
}
.vp-text { flex: 1; min-width: 0; }

/* keep h3/p hidden when used outside .vp-info (before postProcess runs) */
.video-placeholder > h3,
.video-placeholder > p {
  display: none;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  flex-shrink: 0;
  background: var(--red);
  border: 2px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  z-index: 3;
}
.play-btn:hover { background: var(--red-d); transform: scale(1.08); }

/* ─── Real screenshot inside video-placeholder ── */
.vp-screenshot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 0;
}

/* ─── Language switcher ───────────────────── */
.lang-switcher {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--red);
  border: 2px solid var(--red);
  color: #fff;
  padding: 4px 10px;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  line-height: 1;
}
.lang-switcher:hover {
  background: transparent;
  color: var(--red);
}

/* ─── Screen Mockups (CSS-drawn app UIs) ─── */
.screen-mock {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  font-family: var(--f-mono);
}

/* shared titlebar */
.sm-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: #1e1e1e;
  border-bottom: 1px solid #0a0a0a;
  font-size: 10px;
  color: #666;
  flex-shrink: 0;
}
.sm-bar span.title { margin-left: 6px; }
.dot-r { width:10px;height:10px;border-radius:50%;background:#ff5f57;flex-shrink:0; }
.dot-y { width:10px;height:10px;border-radius:50%;background:#febc2e;flex-shrink:0; }
.dot-g { width:10px;height:10px;border-radius:50%;background:#28c840;flex-shrink:0; }

/* ── Terminal ── */
.sm-terminal { background: #0d0d0d; display:flex; flex-direction:column; }
.sm-terminal .sm-bar { background:#141414; }
.sm-term-body { padding:13px 15px; font-size:12px; line-height:1.85; flex:1; overflow:hidden; }
.tp  { color:#e63012; }          /* prompt */
.tc  { color:#ffffff; }          /* command */
.to  { color:#808080; }          /* output */
.ts  { color:#28c840; }          /* success */
.tw  { color:#febc2e; }          /* warning */
.tc2 { color:#61afef; }          /* info/path */
.tcur{ color:#e63012; animation:cur-blink 1s step-end infinite; }
@keyframes cur-blink { 50%{ opacity:0; } }

/* ── Chat (Claude / Cursor AI) ── */
.sm-chat { background:#161616; display:flex; flex-direction:column; }
.sm-chat-body { flex:1; padding:11px 13px; display:flex; flex-direction:column; gap:8px; overflow:hidden; }
.cb { max-width:88%; padding:7px 10px; font-family:var(--f-body); font-size:10.5px; line-height:1.5; }
.cb.u { background:#242424; color:#ddd; align-self:flex-end; border-right:2px solid #555; }
.cb.a { background:#1a1a1a; color:#c8d0dc; align-self:flex-start; border-left:2px solid #e63012; }
.cb.ok { border-left-color:#28c840; }
.cb.dim { opacity:.6; }

/* ── Code editor (Cursor/VS Code) ── */
.sm-editor { background:#1e1e2e; display:flex; flex-direction:column; }
.sm-ed-tabs { display:flex; background:#13131e; border-bottom:1px solid #0a0a1a; }
.sm-tab { padding:5px 13px; font-size:9.5px; color:#444; font-family:var(--f-mono); }
.sm-tab.on { background:#1e1e2e; color:#ccc; border-top:1.5px solid #e63012; }
.sm-ed-body { display:flex; flex:1; overflow:hidden; }
.sm-gutter { padding:10px 8px; background:#191928; color:#3a3a5a; font-size:10px; line-height:1.8; text-align:right; min-width:28px; flex-shrink:0; }
.sm-code { padding:10px 12px; flex:1; font-size:10.5px; line-height:1.8; overflow:hidden; }
.ck  { color:#c678dd; }   /* keyword */
.cs  { color:#98c379; }   /* string */
.cf  { color:#61afef; }   /* function */
.ct  { color:#e06c75; }   /* tag */
.ca  { color:#d19a66; }   /* attr/num */
.cc  { color:#5c6370; font-style:italic; } /* comment */
.sm-ai-bar { width:36%; background:#11111c; border-left:1px solid #1e1e38; padding:10px; display:flex; flex-direction:column; gap:6px; overflow:hidden; }
.sm-ai-label { font-size:8.5px; color:#e63012; font-weight:700; text-transform:uppercase; letter-spacing:1px; }
.sm-ai-bubble { background:#1a1a2a; padding:6px 8px; font-size:9.5px; color:#777; line-height:1.6; border-left:1.5px solid #3a3a6a; }
.sm-ai-bubble.typing::after { content:'▋'; color:#e63012; animation:cur-blink 1s step-end infinite; }

/* ── Web app (light) ── */
.sm-webapp { background:#f2f2f2; display:flex; flex-direction:column; }
.sm-app-bar { background:#1e3a5f; padding:8px 14px; color:#fff; font-size:11px; font-weight:700; display:flex; align-items:center; gap:8px; font-family:var(--f-display); letter-spacing:1px; text-transform:uppercase; flex-shrink:0; }
.sm-app-body { padding:12px 14px; flex:1; display:flex; flex-direction:column; gap:10px; }
.sm-app-row { display:flex; gap:10px; }
.sm-field { flex:1; }
.sm-flabel { font-size:8.5px; color:#666; text-transform:uppercase; letter-spacing:.5px; font-weight:700; margin-bottom:3px; font-family:var(--f-mono); }
.sm-finput { background:#fff; border:1px solid #ccc; padding:5px 8px; font-size:11px; color:#333; width:100%; font-family:var(--f-mono); }
.sm-btn-r { background:#e63012; color:#fff; padding:7px 16px; font-size:10.5px; font-weight:900; border:none; text-transform:uppercase; letter-spacing:1px; cursor:pointer; font-family:var(--f-display); }
.sm-result { border-left:3px solid #28c840; background:#eaf5ea; padding:8px 11px; font-size:10.5px; color:#1b5e20; font-family:var(--f-mono); }

/* ── Flow / n8n ── */
.sm-flow { background:#0f0f1a; display:flex; flex-direction:column; }
.sm-flow-canvas { flex:1; padding:16px 20px; display:flex; align-items:center; justify-content:center; gap:0; overflow:hidden; }
.flow-nd { background:#1a1a2e; border:1.5px solid #3a3a6a; padding:10px 12px; text-align:center; min-width:76px; font-size:9.5px; color:#aaa; }
.flow-nd.trg { border-color:#e63012; }
.flow-nd.out { border-color:#28c840; }
.flow-nd-icon { font-size:18px; display:block; margin-bottom:2px; }
.flow-nd-tag { font-size:7.5px; margin-top:2px; display:block; }
.flow-nd-tag.r { color:#e63012; }
.flow-nd-tag.b { color:#6060aa; }
.flow-nd-tag.g { color:#28c840; }
.flow-conn { display:flex; align-items:center; padding:0 2px; }
.flow-ln { height:1.5px; width:22px; }
.flow-ln.r { background:#e63012; }
.flow-ln.b { background:#4a4a8a; }
.flow-ln.g { background:#28c840; }
.flow-arr { font-size:11px; margin-left:-3px; }

/* ── Security / settings ── */
.sm-security { background:#0d0d12; display:flex; flex-direction:column; }
.sm-sec-body { padding:13px 15px; flex:1; }
.sm-sec-title { font-size:9.5px; color:#e63012; font-weight:700; text-transform:uppercase; letter-spacing:1.2px; margin-bottom:11px; }
.sm-sec-item { display:flex; justify-content:space-between; align-items:center; padding:7px 0; border-bottom:1px solid #1a1a1a; }
.sm-sec-key { font-size:10px; color:#777; font-family:var(--f-body); }
.sm-sec-val { font-size:8.5px; font-weight:700; font-family:var(--f-mono); }
.sm-sec-val.ok  { color:#28c840; }
.sm-sec-val.warn{ color:#febc2e; }
.sm-sec-val.off { color:#e63012; }
.sm-sec-badge { margin-top:11px; background:#0a1a0a; border:1px solid #28c840; padding:7px 9px; font-size:8.5px; color:#4caf50; line-height:1.5; }

/* ─── Steps ───────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: 8px; }

.step {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: var(--b-soft);
  border-left: var(--b-med);
  transition: border-left-color .15s;
}
.step:hover { border-left-color: var(--red); }

.step-number {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 900;
  margin-top: 2px;
}

.step-content { flex: 1; min-width: 0; }
.step-content h4 {
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0;
  margin-bottom: 6px;
}
.step-content p { font-size: 14px; margin-bottom: 10px; }
.step-content p:last-child { margin-bottom: 0; }
.step-content ul { margin-bottom: 0; }
.step-content .code-block { margin-top: 12px; margin-bottom: 0; }

/* ─── Hero ────────────────────────────────── */
.hero {
  text-align: left;
  padding: 0 0 32px;
  margin-bottom: 32px;
  border-bottom: var(--b-heavy);
}
.hero h1 {
  font-size: 64px;
  letter-spacing: -2px;
  line-height: .85;
  margin-bottom: 18px;
}
.hero h1 em {
  color: var(--red);
  font-style: normal;
  display: block;
}
.hero p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.65;
  margin-bottom: 28px;
}

.hero-stats {
  display: flex;
  gap: 0;
  border: var(--b-heavy);
  background: var(--surface);
  max-width: 420px;
}
.hero-stat {
  flex: 1;
  padding: 16px 14px;
  border-right: var(--b-med);
  text-align: center;
}
.hero-stat:last-child { border-right: none; }
.hero-stat .number {
  display: block;
  font-family: var(--f-mono);
  font-size: 30px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  margin-bottom: 4px;
}
.hero-stat .label {
  font-family: var(--f-display);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-subtle);
}

/* ─── Module grid ─────────────────────────── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.module-card {
  background: var(--surface);
  border: var(--b-soft);
  border-left: var(--b-med);
  padding: 18px 20px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: inherit;
}
.module-card:hover { border-left-color: var(--red); }
.module-card .module-number {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
}
.module-card h3 {
  font-family: var(--f-display);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-top: 0;
  margin-bottom: 6px;
}
.module-card p { font-size: 13px; color: var(--text-muted); margin: 0; }
.module-card .module-meta {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-subtle);
}

/* ─── Module type badge ───────────────────── */
.mod-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  background: var(--black);
  padding: 4px 10px 4px 8px;
  margin-bottom: 16px;
}
.mod-type-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--red);
  flex-shrink: 0;
}

/* ─── Glossary ────────────────────────────── */
.glossary-term {
  font-family: var(--f-mono);
  background: var(--cream-d);
  padding: 1px 7px;
  font-weight: 600;
  cursor: help;
  border-bottom: 1px solid var(--black);
  color: var(--black);
  font-size: .85em;
}

/* ─── Overlay ─────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,.65);
  z-index: 99;
}

/* ─── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .menu-btn { display: flex; align-items: center; }
  .overlay.show { display: block; }

  .content-body { padding: 28px 20px; }
  .content-header { padding: 0 20px; }
  .content-footer { padding: 0 20px; }

  .content-body h1 { font-size: 38px; }
  .hero h1 { font-size: 42px; }
  .hero-stats { flex-direction: column; max-width: 100%; }
  .hero-stat { border-right: none; border-bottom: var(--b-soft); }
  .hero-stat:last-child { border-bottom: none; }
  .module-grid { grid-template-columns: 1fr; }
  .step { gap: 12px; padding: 14px 16px; }
}

/* ─── Print ───────────────────────────────── */
@media print {
  .sidebar, .content-header, .content-footer, .overlay { display: none !important; }
  .main-content { margin-left: 0; }
  .content-body { max-width: none; padding: 0; }
}

/* ─── Inline logos (Simple Icons in list/table) ── */
.inline-logo {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 5px;
  flex-shrink: 0;
  position: relative;
  top: -1px;
}

/* ─── Tab logo icons ──────────────────────── */
.tab-logo {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─── Animations ──────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.content-body > * {
  animation: fadeInUp .28s ease forwards;
}
