:root {
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --accent: #007AFF;
    --text-p: #1C1C1E;
    --text-s: #8E8E93;
    --max-w: 640px;
    --header-h: 70px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text-p);
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    padding-top: var(--header-h);
    -webkit-font-smoothing: antialiased;
}

.site-header {
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Home */
.page-hero { text-align: center; padding: 40px 0 20px; }
.page-hero h1 { font-size: 3rem; font-weight: 900; letter-spacing: -0.06em; margin: 0; }
.page-hero h1 span { color: var(--accent); }
.page-hero p { color: var(--text-s); margin-top: 10px; font-size: 1.1rem; }

/* Busca Moderna High-End */
.search-wrapper { margin: 20px 0 50px; position: relative; }
.search-box { 
    background: #F1F5F9; border-radius: 100px; display: flex; align-items: center; 
    padding: 6px 24px; border: 2px solid transparent; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.search-box i { color: #94A3B8; font-size: 1.4rem; }
.search-box input { 
    border: none; background: transparent; width: 100%; padding: 18px 15px; 
    font-size: 1.15rem; outline: none; font-family: inherit; font-weight: 500; color: var(--text-p);
}
.search-box input::placeholder { color: #94A3B8; }
.search-box:focus-within { 
    background: #fff; border-color: var(--accent); 
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.15);
    transform: translateY(-2px);
}

/* Tool Cards */
.tool-row {
    display: flex; align-items: center; gap: 16px; padding: 18px;
    background: white; border-radius: 22px; border: 1px solid rgba(0,0,0,0.02);
    box-shadow: var(--shadow); text-decoration: none; color: inherit;
    transition: 0.2s; margin-bottom: 12px;
}
.tool-row:hover { transform: translateY(-2px); border-color: var(--accent); }

.tool-icon-mini { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.tool-icon-mini.red { background: #fff0f0; color: #ff3b30; }
.tool-icon-mini.blue { background: #f0f7ff; color: #007aff; }
.tool-icon-mini.green { background: #f0fff4; color: #34c759; }
.tool-icon-mini.purple { background: #f5f0ff; color: #5856d6; }

.tool-info h3 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.tool-info p { margin: 2px 0 0; color: var(--text-s); font-size: 0.85rem; line-height: 1.3; }

/* Article */
.calculator-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.2; margin: 15px 0 10px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-s); text-decoration: none; font-weight: 600; font-size: 0.9rem; }

@media (max-width: 600px) {
    :root { --header-h: 60px; }
    .container { padding: 0 16px; }
    .page-hero h1 { font-size: 2.2rem; }
    .calculator-title { font-size: 1.4rem; }
    .tool-row { padding: 14px; border-radius: 18px; }
}

/* BOX CLÍNICO (A la MedCalc) */
.clinical-box {
    margin-top: 25px;
    padding: 20px 24px;
    background: #f0f7ff;
    border-left: 6px solid var(--accent);
    border-radius: 6px 20px 20px 6px;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.05);
}
.clinical-box-title {
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.clinical-box-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1e40af;
    font-weight: 500;
}
.clinical-box-content ul { padding-left: 18px; margin: 10px 0 0 0; }
.clinical-box-content li { margin-bottom: 8px; }

/* Categories Section */
.categories-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px dashed rgba(0,0,0,0.08);
}
.cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}
.cat-header i {
    font-size: 24px;
    color: var(--accent);
    background: rgba(0, 122, 255, 0.1);
    padding: 8px;
    border-radius: 10px;
}
.cat-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-p);
    letter-spacing: -0.03em;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.cat-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    border-radius: 20px;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.04);
}

.cat-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-p);
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

.cat-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cat-item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-s);
    text-decoration: none;
    transition: color 0.2s ease;
}
.cat-item-link i {
    color: #cbd5e1;
    font-size: 16px;
    transition: transform 0.2s ease, color 0.2s ease;
}
.cat-item-link:hover {
    color: var(--accent);
}
.cat-item-link:hover i {
    color: var(--accent);
    transform: translateX(3px);
}

@media (max-width: 600px) {
    .cat-grid { grid-template-columns: 1fr; }
    .cat-card { padding: 20px; }
}

.tool-icon-mini.orange { background: #fff7ed; color: #f97316; }
.tool-icon-mini.teal { background: #f0fdfa; color: #0d9488; }

/* Fix para Hashtags e Scroll Horizontal */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.category-tags { 
    font-size: 0.8rem; 
    margin-bottom: 25px; 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
    width: 100%;
}

.category-tags a {
    text-decoration: none;
    display: inline-flex;
    max-width: 100%;
}

.category-tags span { 
    color: var(--accent); 
    font-weight: 700;
    white-space: nowrap; /* Impede que a hashtag quebre no meio do texto */
}

@media (max-width: 600px) {
    .category-tags {
        gap: 6px;
    }
    .calculator-title {
        word-wrap: break-word; /* Garante que títulos longos não empurrem a tela */
    }
}

.tool-icon-mini.yellow { background: #fefce8; color: #eab308; }
.tool-icon-mini.rose { background: #fff1f2; color: #f43f5e; }
.tool-icon-mini.amber { background: #fffbeb; color: #b45309; }
