:root {
    /* Primary theme colors */
    --primary-color: #9782bc;
    --primary-hover: #765ea0;
    
    /* Text colors */
    --text-primary: #333;
    --text-secondary: #666;
    --text-tertiary: #495057;
    
    /* Background colors */
    --bg-body: #f8f9fa;
    --bg-container: white;
    --bg-section: #f8f9fa;
    
    /* Border colors */
    --border-light: #e9ecef;
    
    /* Shadow colors */
    --shadow-light: rgba(0,0,0,0.1);
    --shadow-medium: rgba(0,0,0,0.2);
    
    /* Clause formatting */
    --clause-number-width: 2em;
    --sub-clause-number-width: 3em;
    --sub-sub-clause-number-width: 3.5em;
    --sub-clause-margin: 2.5em;
    --sub-sub-clause-margin: 3.5em;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-container);
    box-shadow: 0 0 20px var(--shadow-light);
    border-radius: 8px;
    margin-top: 20px;
    margin-bottom: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
}

h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.last-updated {
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 10px;
}

.toc {
    background-color: var(--bg-section);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}

.toc h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.toc ol {
    list-style: none;
    counter-reset: toc-counter;
}

.toc li {
    counter-increment: toc-counter;
    margin-bottom: 8px;
}

.toc li::before {
    content: counter(toc-counter) ". ";
    font-weight: bold;
    color: var(--primary-color);
    display: inline-block;
    width: 2em;
}

.toc a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 4px 0;
    display: inline-block;
}

.toc a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

h2 {
    color: var(--primary-color);
    font-size: 1.5em;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-light);
}

h3 {
    color: var(--text-tertiary);
    font-size: 1.2em;
    margin-top: 25px;
    margin-bottom: 15px;
}

p {
    margin-bottom: 15px;
    text-align: justify;
}

.clause {
    margin-bottom: 20px;
}

.clause-number {
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 8px;
    display: inline-block;
    width: var(--clause-number-width);
}

.sub-clause {
    margin-left: var(--sub-clause-margin);
    margin-bottom: 10px;
}

.sub-clause .clause-number {
    width: var(--sub-clause-number-width);
}

.sub-sub-clause {
    margin-left: var(--sub-sub-clause-margin);
    margin-bottom: 8px;
}

.sub-sub-clause .clause-number {
    width: var(--sub-sub-clause-number-width);
}

.definition-term {
    font-weight: bold;
    color: var(--text-tertiary);
}

.email-link {
    color: var(--primary-color);
    text-decoration: none;
}

.email-link:hover {
    text-decoration: underline;
}

.url-link {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
}

.url-link:hover {
    text-decoration: underline;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 2px 10px var(--shadow-medium);
    transition: background-color 0.3s;
}

.back-to-top:hover {
    background-color: var(--primary-hover);
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .sub-clause {
        margin-left: 15px;
    }
    
    .sub-sub-clause {
        margin-left: 30px;
    }
}

@media print {
    body {
        background-color: white !important;
    }
    
    .container {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 20px !important;
        background-color: white !important;
    }
    
    .back-to-top {
        display: none !important;
    }
}