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

:root {
    --background: #000000e7;
    --foreground: #e5e5e5;
    --card: #161616e7;
    --card-foreground: #e5e5e5;
    --primary: #80d82d;
    --primary-foreground: #0a0a0a;
    --secondary: #1f1f1f;
    --secondary-foreground: #d4d4d4;
    --muted: #262626;
    --muted-foreground: #737373;
    --accent: #6ea739;
    --accent-foreground: #0a0a0a;
    --border: #262626;
    --input: #1f1f1f;
    --ring: #b0e282;
    --warning: #fbbf24;
    --sidebar-background: #161616;
    --sidebar-foreground: #a3a3a3;
    --sidebar-border: #1f1f1f;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 18px;

  --bg-app: var(--background);
  --bg-top: var(--card);
  --bg-sidebar: var(--sidebar-background);
  --bg-card: var(--card);
  --bg-hover: var(--secondary);

  --text: var(--foreground);
  --text-2: var(--sidebar-foreground);
  --text-3: var(--muted-foreground);

  --border-2: rgba(255,255,255,.10);

  --shadow-sm: 0 6px 16px rgba(0,0,0,.28);
  --shadow-md: 0 14px 30px rgba(0,0,0,.38);
  --shadow-lg: 0 18px 40px rgba(0,0,0,.45);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
    height: 56px;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-radius: 0 0 14px 14px;
    backdrop-filter: blur(8px);
    background: rgba(22,22,22,.85);
    -webkit-backdrop-filter: blur(8px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.header-title {
    font-weight: 600;
    color: var(--foreground);
}

.search-container {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 2rem;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 28rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--muted-foreground);
}

.search-input {
    width: 100%;
    padding: 0.5rem 4rem 0.5rem 2.25rem;
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--foreground);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: rgba(128,216,45,.55);
    box-shadow: 0 0 0 4px rgba(128,216,45,.12);
}

.search-input::placeholder {
    color: var(--muted-foreground);
}

.search-shortcuts {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.search-shortcuts kbd {
    padding: 0.125rem 0.375rem;
    background-color: var(--muted);
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 50;
    max-height: 400px;
    overflow-y: auto;
}

.search-results.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--foreground);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s;
}

.search-result-item:hover {
    background-color: var(--secondary);
}

.search-result-icon {
    width: 1rem;
    height: 1rem;
    color: var(--muted-foreground);
}

.header-spacer {
    width: 180px;
}

:root{
  --sidebar-w: 260px;
  --sidebar-gap: 12px;
}

.sidebar{
  width: var(--sidebar-w);
  position: fixed;
  left: var(--sidebar-gap);
  top: calc(56px + var(--sidebar-gap));
  height: calc(100vh - 56px - (var(--sidebar-gap) * 2));
  z-index: 45;

  margin: 0;
  padding: 10px 8px;

  background: rgba(18,18,18,.92);              /* mais “docs” */
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;                          /* menos “bolado” */
  box-shadow: 0 10px 26px rgba(0,0,0,.35);      /* leve */

  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar{ width:0; height:0; }

.sidebar-chapter{
  margin: 6px 0 10px;
}

.sidebar-chapter-title {
    padding: 0.5rem 1rem;
    font-size: 0.688rem;
    font-weight: 700;
    color: var(--muted-foreground);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar-chapter:first-child .sidebar-chapter-title{
  border-top: none;
  margin-top: 0;
}

.sidebar-chapter-title::after{
  content: "";
  display: block;
  height: 1px;
  margin-top: 0.55rem;
  background: linear-gradient(to right, rgba(255,255,255,.10), transparent);
}

.sidebar-items{
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-item{
  position: relative;
  display:flex;
  align-items:center;
  gap: 10px;

  width: 100%;
  padding: 9px 10px;
  margin: 2px 0;

  font-size: 0.90rem;
  color: rgba(229,229,229,.70);

  background: transparent;
  border: none;
  border-radius: 10px;     /* só pra hover não ficar quadrado */
  cursor: pointer;

  transition: background .14s ease, color .14s ease;
}

.sidebar-item:hover {
    color: var(--foreground);
    background-color: #1f1f1f;
    transform: translateX(2px);
}

.sidebar-item.active {
    background-color: rgba(128,216,45,.14);
    color: var(--primary);
    font-weight: 500;
    box-shadow: 0 0 0 1px rgba(128,216,45,.25),
              0 0 12px rgba(128,216,45,.15);
}

.sidebar-item.active::before{
  content: "";
  position: absolute;
  left: -6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--primary);
}

.sidebar-item-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: .9;
}

.sidebar-item.active .sidebar-item-icon {
    color: var(--primary);
}

.sidebar-item:not(.active) .sidebar-item-icon{
  opacity: .65;
}

.sidebar::-webkit-scrollbar{
  width: 0;
  height: 0;
}

/* Main Content */
.main-content{
  margin-left: calc(256px + 24px); /* largura + margem */
  margin-top: 56px;
  min-height: 100vh;
  padding: 2rem;
}


.rule-content {
    line-height: 1.75;
    max-width: 48rem;
    margin: 0 auto;
    animation: contentIn .18s ease-out;
    will-change: transform;
    
    background: var(--card);     
    border: 1px solid var(--border);
    border-radius: 18px;         
    padding: 2.5rem;             
    box-shadow: 0 8px 15px rgba(0,0,0,.35); 
    transition: transform .2s ease, box-shadow .2s ease;
}

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

.rule-content:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,.45);
}

.chapter-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.rule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

.rule-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rule-icon{
  font-size: 1.5rem;   /* aumenta o ícone */
  line-height: 1;      /* evita desalinhamento */
  width: auto;
  height: auto;
}


.rule-title {
    font-size: 1.9rem;
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--foreground);
    line-height: 1.15;
}

.copy-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: none;
    border: none;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.15s;
}

.copy-button:hover {
    color: var(--foreground);
    background-color: var(--muted);
}

.copy-button i {
    font-size: 1rem;
}

.rule-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.section-text{
  margin: 0 0 0.9rem;
  color: rgba(226, 228, 233, 0.92);
  line-height: 1.7;
  font-size: 0.98rem;
}
.section-text + .section-text{
  margin-top: -0.35rem; /* junta parágrafos sem “buracão” */
}

.section-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.section-item{
  display: flex;
  align-items: flex-start;   /* 🔥 alinha no topo da primeira linha */
  gap: 0.75rem;
  color: rgba(226, 228, 233, 0.9);
}

.section-item-bullet{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 0.55em;
  opacity: .75;
  flex: 0 0 auto;
}

.section-item-text{
  line-height: 1.6;
  font-size: 0.938rem;
}

.section-divider{
  display: none;
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border),
    transparent
  );
}


.rule-observation {
    margin-top: 2rem;
    color: var(--warning);
    font-style: italic;
    font-size: 0.938rem;
}

.rule-observation strong {
    font-weight: 600;
}

.rule-navigation {
    margin-top: 3rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: var(--card);
    display: flex;
    border-radius: 14px;
}

.nav-button {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--foreground);
    cursor: pointer;
    transition: background-color 0.15s;
}

.nav-button:hover {
    background-color: var(--secondary);
}

.nav-button:first-child {
    border-right: 1px solid var(--border);
    text-align: left;
}

.nav-button:last-child {
    justify-content: flex-end;
    text-align: right;
}

.nav-button-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-button-label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.nav-button-title {
    color: var(--foreground);
    font-weight: 500;
}

.nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--muted-foreground);
    margin: 0 1rem;
}

.nav-spacer {
    flex: 1;
    padding: 1rem;
    border-right: 1px solid var(--border);
}

.nav-spacer:last-child {
    border-right: none;
}

.rule-last-updated {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 100;
}

.toast {
    background-color: var(--card);
    color: var(--foreground);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 3px solid var(--primary);
}

.toast-icon {
    color: var(--primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header-spacer {
        display: none;
    }
}

.sidebar-item.active .sidebar-item-icon {
    color: var(--primary);
    transform: scale(1.08);
}

.nav-button,
.copy-button,
.sidebar-item {
    border-radius: 12px;
}

.accent{
  color: var(--primary);
  font-weight: 600;
}

strong{
  font-weight: 800;      /* bem mais forte */
  color: #ffffff;        /* mais contraste no dark */
}

/* ================================
   Universal Components (All Tabs)
================================ */

/* Tables */
.section-table-wrap{
  width: 100%;
  overflow: auto;

  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
  box-shadow: var(--shadow-sm);
}

.section-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.section-table th,
.section-table td{
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  white-space: nowrap;
}

.section-table thead th{
  font-weight: 900;
  color: rgba(229,229,229,.92);
  background: linear-gradient(to bottom, rgba(255,255,255,.05), rgba(255,255,255,.02));
}

.section-table tbody td{
  color: rgba(229,229,229,.82);
}

.section-table tbody tr:hover{
  background: rgba(255,255,255,.04);
}

/* Blockquote / highlight text */
.quote{
  margin-top: 12px;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  position: relative;
}

.quote::before{
  content:"";
  position:absolute;
  left: 10px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--primary), rgba(128,216,45,.35));
}

.quote p{ margin-left: 10px; color: rgba(229,229,229,.84); }


/* Observation (bottom note) */
.rule-observation{
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 16px;

  border: 1px solid rgba(251,191,36,.22);
  background: rgba(251,191,36,.06);
  color: rgba(251,191,36,.92);
  font-style: italic;
}

/* Info / Danger cards (usable everywhere) */
.info-card,
.danger-card{
  display:flex;
  gap: 12px;
  align-items:flex-start;

  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
  box-shadow: var(--shadow-sm);
  margin-top: 12px;
}

.info-card-icon,
.danger-card-icon{
  width: 32px;
  height: 32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 12px;
  flex: 0 0 auto;
}

.info-card-icon{
  color: var(--primary);
  background: rgba(128,216,45,.10);
  border: 1px solid rgba(128,216,45,.20);
}

.danger-card{
  border-color: rgba(255,82,82,.22);
  background: rgba(255,82,82,.06);
}

.danger-card-icon{
  color: #ff5252;
  background: rgba(255,82,82,.12);
  border: 1px solid rgba(255,82,82,.22);
}

.info-card-text,
.danger-card-text{
  color: rgba(229,229,229,.72);
  line-height: 1.6;
  font-size: .95rem;
}

.info-card-text strong,
.danger-card-text strong{
  color: rgba(255,255,255,.96);
  font-weight: 900;
}


.uniform-figure{
  display:flex;
  justify-content:center;
  margin: 18px 0 6px;
}

.uniform-image{
  width: min(520px, 100%);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.uniform-block{
  margin-top: 14px;
}

.uniform-subtitle{
  margin: 14px 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--foreground);
}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.90rem;
  line-height: 1.5;
  color: var(--foreground);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.accent{
  color: var(--primary);
  font-weight: 600;
}