.markdown-content {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.markdown-content h1:first-of-type {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: #2a4365;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.markdown-content h1:not(:first-of-type) {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2b6cb0;
}

.markdown-content p {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
    color: #2d3748;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: #f7fafc;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid #cbd5e0;
    padding: 0.75rem 1rem;
    text-align: left;
}

.markdown-content th {
    background: #e2e8f0;
    font-weight: bold;
}

.markdown-content ol {
    margin-left: 2rem;
    padding-left: 1rem;
    list-style-type: decimal;
}

.markdown-content ul {
    margin-left: 2rem;
    padding-left: 1rem;
    list-style-type: disc;
}

.markdown-content li {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    color: #2d3748;
}

.markdown-content li p,
.markdown-content ol p {
    margin-bottom: 0.3rem;
}

.scroll-to-top {
    display: none;
    position: fixed;
    bottom: 32px;
    right: 52px;
    z-index: 1000;
    background: #2b6cb0;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.15);
    transition: background 0.2s;
}
.scroll-to-top:hover {
    background: #2a4365;
}

@media (max-width: 600px) {
    .markdown-content {
        max-width: 100%;
        margin: 1rem;
        padding: 1rem;
        border-radius: 4px;
    }

    .markdown-content h1:first-of-type {
        font-size: 2rem;
        padding-bottom: 0.3rem;
    }

    .markdown-content h1:not(:first-of-type) {
        font-size: 1.4rem;
        margin-top: 1.2rem;
        margin-bottom: 0.7rem;
    }

    .markdown-content p,
    .markdown-content li {
        font-size: 1rem;
    }

    .markdown-content table,
    .markdown-content th,
    .markdown-content td {
        font-size: 0.95rem;
        padding: 0.5rem;
    }

    .markdown-content ol,
    .markdown-content ul {
        margin-left: 1rem;
        padding-left: 0.5rem;
    }

    .scroll-to-top {
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

/* Native app: the app draws its own bottom chrome (tab bar) over the web view, so the floating
   back-to-top button has to sit above it instead of underneath, where it cannot be tapped.
   .nd-native-app is set on <body> by new-design-master-layout.blade.php (this page extends it) -
   server-side for the new app, plus a UA check there for the old one, whose plain-string
   User-Agent isNativeApp() cannot read.

   Specificity 0,2,0 against the base rule and the <=600px override above (both 0,1,0), so it wins
   at every width without !important and without a media query of its own. On the web both of those
   keep applying unchanged - this rule only ever matches inside the app. */
.nd-native-app .scroll-to-top {
  bottom: 90px;
}
