* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
    overflow-x: hidden;
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.hero {
    margin-top: 60px;
    background: var(--gradient-primary);
    color: white;
    padding: 8rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.warning-box {
    background: rgba(245, 158, 11, 0.15);
    border: 2px solid rgba(245, 158, 11, 0.5);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.warning-icon {
    font-size: 1.5rem;
}

.section {
    padding: 4rem 2rem;
}

.bg-light {
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.section h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s, box-shadow 0.3s;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.param-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.function-signature {
    background: var(--dark-bg);
    color: #10b981;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    white-space: nowrap;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.param-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.param-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.param-card.highlight {
    border: 2px solid var(--warning-color);
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
}

.param-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.param-num {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
}

.param-name {
    flex: 1;
    font-weight: 600;
}

.param-type {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.param-body {
    padding: 1.5rem;
}

.param-body p {
    margin-bottom: 0.5rem;
}

.param-body code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e11d48;
}

.tip {
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    border-radius: 4px;
    color: #1e40af;
}

.warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    border-radius: 4px;
    color: #92400e;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
}

.input-group button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

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

.result {
    min-height: 40px;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.steps {
    margin-top: 3rem;
}

.step {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.code-block {
    background: #1e293b;
    color: #10b981;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
}

.checklist {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 3rem;
    border: 2px solid var(--success-color);
}

.checklist h3 {
    color: var(--success-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.checklist ul {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 2rem;
}

.checklist li::before {
    content: '☐';
    position: absolute;
    left: 0;
    top: 0.75rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.faq-item {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cta h2 {
    color: white;
}

.warning-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.warning-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.warning-item .icon {
    font-size: 2rem;
}

.footer {
    background: var(--dark-bg);
    color: white;
    padding: 2rem;
    text-align: center;
}

.disclaimer {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Scanner Tutorial Styles */
.scanner-tutorial {
    margin-top: 2rem;
}

.alert-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e6 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.alert-icon {
    font-size: 1.5rem;
}

.scanner-steps {
    margin-top: 2rem;
}

.scanner-step {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-badge {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.scanner-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.scanner-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.scanner-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.chain-icon {
    font-size: 1.2rem;
}

.example-box {
    background: #1e293b;
    color: #10b981;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    margin: 1rem 0;
}

.tab-example, .subtab-example {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
}

.tab-item, .subtab-item {
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.tab-item.highlighted, .subtab-item.highlighted {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    font-weight: bold;
}

.connect-button-example {
    margin: 1rem 0;
}

.connect-btn {
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.function-list-example {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.function-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.function-item:last-child {
    border-bottom: none;
}

.function-item.highlighted {
    background: #f0fdf4;
    border: 2px solid var(--success-color);
    border-radius: 6px;
    padding: 1rem;
    margin: 0.5rem 0;
}

.important-note {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    margin: 1.5rem 0;
    display: flex;
    gap: 1rem;
    border-radius: 4px;
}

.note-icon {
    font-size: 1.5rem;
}

.param-input-example {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

.param-input-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.param-input-fields {
    padding: 1.5rem;
}

.input-field {
    margin-bottom: 1rem;
}

.input-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-field input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
}

.input-field.special {
    background: #fef3c7;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.field-note {
    display: inline-block;
    margin-left: 1rem;
    color: #92400e;
    font-weight: 500;
}

.common-mistakes {
    background: #fef2f2;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
}

.common-mistakes h3 {
    color: var(--error-color);
    margin-bottom: 1.5rem;
}

.mistake-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.mistake-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.mistake-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.verification-section {
    background: #f0fdf4;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
}

.verification-section h3 {
    color: var(--success-color);
    margin-bottom: 1.5rem;
}

.verify-steps {
    display: grid;
    gap: 1.5rem;
}

.verify-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.verify-num {
    background: var(--success-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.quick-find-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 1.5rem;
}

.param-detail-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.param-detail-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.inline-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.inline-param-card {
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.inline-param-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.inline-param-card.highlight {
    background: #fef3c7;
    border: 2px solid #f59e0b;
}

.inline-param-header {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.inline-param-card.highlight .inline-param-header {
    background: linear-gradient(135deg, #fed7aa 0%, #fbbf24 100%);
}

.param-index {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
}

.inline-param-card.highlight .param-index {
    background: #ea580c;
}

.inline-param-header code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.param-type-badge {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
}

.inline-param-body {
    padding: 1rem;
}

.inline-param-body p {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.inline-param-body code {
    background: white;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #0ea5e9;
    font-size: 0.9rem;
}

.inline-tip {
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    border-radius: 3px;
    color: #1e40af;
    font-size: 0.9rem;
}

/* Tutorial Step Styles */
.tutorial-step {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.prepare-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.prepare-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.prepare-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.tool-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.tool-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.helper-tools {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
    border: 2px solid var(--primary-color);
}

.helper-tools h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.inline-warning {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    border-radius: 3px;
    color: #92400e;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Touch optimization */
button, a {
    touch-action: manipulation;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    /* Navigation */
    .navbar {
        padding: 0.75rem 0;
    }

    .nav-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .nav-logo {
        font-size: 1.2rem;
    }

    .nav-menu {
        gap: 0.5rem;
        font-size: 0.85rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-menu a {
        padding: 0.25rem 0.5rem;
    }

    /* Hero Section */
    .hero {
        margin-top: 100px;
        padding: 3rem 1rem 2.5rem;
    }

    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }

    .subtitle {
        font-size: 1rem !important;
    }

    .warning-box {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Sections */
    .section {
        padding: 2rem 1rem;
    }

    .container {
        padding: 0;
    }

    /* Info Cards */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .info-card {
        padding: 1.25rem;
    }

    .info-card h3 {
        font-size: 1.1rem;
    }

    /* Prepare Cards */
    .prepare-steps {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .prepare-card {
        padding: 1.25rem;
    }

    .prepare-card h3 {
        font-size: 1.1rem;
    }

    /* Chain Selector */
    .chain-selector div {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .chain-item {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    /* Tutorial Steps */
    .tutorial-step {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .step-badge {
        font-size: 0.85rem;
    }

    .step-header h3 {
        font-size: 1.1rem;
    }

    /* Scanner Links */
    .scanner-links {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .scanner-link {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Tab Examples */
    .tab-example, .subtab-example {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .tab-item, .subtab-item {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Fee Recommendation */
    .fee-recommendation {
        padding: 1rem;
    }

    /* Input Fields */
    .input-field input {
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    .field-note {
        font-size: 0.75rem !important;
    }

    /* Code Blocks */
    .example-box, .code-block, .result-box {
        font-size: 0.8rem;
        padding: 0.75rem;
        overflow-x: auto;
    }

    /* Param Input Example */
    .param-input-example {
        font-size: 0.85rem;
    }

    .param-input-header {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .param-input-fields {
        padding: 1rem;
    }

    /* Helper Tools */
    .tool-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tool-card {
        padding: 1rem;
    }

    .tool-card h4 {
        font-size: 1rem;
    }

    /* Mistakes Grid */
    .mistake-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .mistake-item {
        font-size: 0.9rem;
    }

    /* FAQ Grid */
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .faq-item {
        padding: 1.25rem;
    }

    .faq-item h3 {
        font-size: 1rem;
    }

    /* Warning List */
    .warning-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .warning-item {
        padding: 1rem;
        font-size: 0.9rem;
    }

    /* Verification Section */
    .verification-section {
        padding: 1.25rem;
    }

    .verify-steps {
        gap: 1rem;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 1rem;
        text-align: center;
    }

    .disclaimer {
        font-size: 0.8rem;
    }

    /* Buttons */
    button {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    /* Section Headings */
    .section h2 {
        font-size: 1.75rem;
        margin-bottom: 1.25rem;
    }

    /* Inline Params Grid */
    .inline-params-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Params Grid */
    .params-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .inline-param-card {
        font-size: 0.85rem;
    }

    .inline-param-header {
        padding: 0.5rem 0.75rem;
    }

    .inline-param-body {
        padding: 0.75rem;
    }

    /* Step Content */
    .step-content {
        font-size: 0.9rem;
    }

    .steps {
        margin-top: 1.5rem;
    }

    .step {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    /* Details/Summary */
    details summary {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* CTA Section */
    .cta {
        padding: 2rem 1rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    nav {
        padding: 0.75rem 0;
    }

    .nav-container {
        padding: 0 0.75rem;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    .nav-menu a {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }


    .hero {
        margin-top: 90px;
        padding: 2.5rem 0.75rem 2rem;
    }

    .hero h1 {
        font-size: 1.4rem;
        word-wrap: break-word;
    }

    .subtitle {
        font-size: 0.9rem !important;
    }

    .section {
        padding: 1.5rem 0.75rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    /* Make all grids single column */
    .info-grid,
    .prepare-steps,
    .params-grid,
    .inline-params-grid,
    .tool-grid,
    .mistake-grid,
    .faq-grid,
    .warning-list {
        grid-template-columns: 1fr !important;
    }

    /* Reduce padding and font sizes further */
    .info-card,
    .prepare-card,
    .tutorial-step,
    .faq-item {
        padding: 1rem;
    }

    /* Ensure code blocks are scrollable */
    code,
    .code-block,
    .example-box,
    .result-box,
    .function-signature {
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 0.75rem;
    }

    /* Adjust input fields */
    input[type="text"] {
        width: 100%;
        font-size: 0.8rem;
    }

    /* Smaller buttons on mobile */
    button {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
        width: 100%;
    }

    /* Chain selector for small screens */
    .chain-selector div {
        grid-template-columns: 1fr;
    }

    .chain-item {
        font-size: 0.8rem;
        padding: 10px;
    }

    /* Input fields for iOS */
    input[type="text"],
    input[type="number"] {
        font-size: 16px;
        -webkit-appearance: none;
    }
}

/* Very small screens (320px and below) */
@media (max-width: 320px) {
    .hero h1 {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.85rem !important;
    }

    .nav-menu a {
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }
}

/* Ensure horizontal scroll for wide content */
.param-input-example,
.function-signature,
.code-block,
.example-box {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Prevent content from being cut off */
pre, code {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Ensure images and embeds are responsive */
img,
iframe,
video {
    max-width: 100%;
    height: auto;
}