:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1400px;
    padding: 0 15px;
    margin: auto;
}

h1 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #000;
    border-bottom: 2px solid var(--teal);
    padding-bottom: 10px;
    text-align: center;
}

h2 {
    font-size: 1.125rem;
    color: #ff6b6b;
}

.bold-heading {
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
    color: #000;
}

.section-title {
    font-size: 1rem;
    color: #000;
    font-weight: bold;
}

@media (min-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    .section-title { font-size: 1.25rem; }
}

@media (min-width: 1025px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.375rem; }
    .section-title { font-size: 1.25rem; }
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Mobile layout */
.main-content {
    width: 100%;
}

.calculator-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 480px) {
    .calculator-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #000;
}

input, select, button {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    color: #000;
}

button {
    background-color: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.btn-secondary {
    background-color: var(--secondary);
}

.btn-teal {
    background-color: var(--teal);
}

.result-container {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: none;
}

.result-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #000;
    margin: 1rem 0;
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.recommendation {
    background-color: #e8f4f8;
    border-left: 4px solid var(--teal);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    color: #000;
}

.visual-progress {
    height: 24px;
    background-color: #e0e0e0;
    border-radius: 12px;
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--teal), #2a9d8f);
    width: 0%;
    transition: width 1s ease;
}

.export-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.export-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem;
    font-size: 1rem;
}

.height-input-group {
    display: flex;
    gap: 10px;
}

.height-input-group > div {
    flex: 1;
}

.ad-container {
    background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%);
    border: 1px dashed #ced4da;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    font-size: 1rem;
    margin: 0 auto;
    border-radius: 8px;
}

#ad-left, #ad-right {
    display: none;
}

#ad-mobile {
    width: 320px;
    height: 100px;
    margin-top: 20px;
}

#ad-tablet {
    display: none;
    width: 300px;
    height: 250px;
    margin-top: 20px;
}

#related-tools {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    font-size: 1rem;
    
}

.tools-list {
    list-style: none;
}

.tools-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

.tools-list li:last-child {
    border-bottom: none;
}

.tools-list a {
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tools-list a:hover {
    color: var(--teal);
}

@media (min-width: 768px) and (max-width: 1024px) {
    #ad-mobile {
        display: none;
    }
    
    #ad-tablet {
        display: flex;
    }
    
    .ad-tablet-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

@media (min-width: 1025px) {
    .content-wrapper {
        flex-direction: row;
        gap: 1rem;
    }
    
    .left-sidebar, .right-sidebar {
        width: 300px;
        position: sticky;
        top: 20px;
        align-self: flex-start;
        height: 100vh;
        overflow-y: auto;
    }
    
    .main-content {
        flex: 1;
    }
    
    #ad-left, #ad-right {
        display: flex;
        height: 250px;
        margin-bottom: 1rem;
    }
    
    #ad-right {
        height: 600px;
    }
    
    #ad-mobile, #ad-tablet {
        display: none;
    }
    
    .calculator-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .btn-group {
        grid-template-columns: 1fr 1fr;
    }
    
    .calculator-grid > .form-group:nth-child(7) {
        grid-column: 1;
        grid-row: 3;
    }
    
    .calculator-grid > .form-group:nth-child(9) {
        grid-column: 2;
        grid-row: 3;
    }
    
    .calculator-grid > .form-group:nth-child(8) {
        grid-column: 3;
        grid-row: 3;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.schedule-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    color: #000;
}

.schedule-item strong {
    color: #000;
}

.schedule-desc {
    font-size: 1rem;
    color: var(--text-light);
    margin-top: 5px;
}

.unit-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.unit-btn {
    flex: 1;
    background: white;
    color: #000;
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.unit-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.unit-btn:hover:not(.active) {
    background: #f1f3f5;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.plain-text-result {
    display: none;
    white-space: pre-wrap;
    font-family: monospace;
    padding: 15px;
    background: white;
    border: 1px solid #ccc;
    margin-top: 15px;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #000;
}

@media print {
    body * {
        visibility: hidden;
    }
    .result-container, .result-container * {
        visibility: visible;
    }
    .result-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        border: none;
        padding: 20px;
        height: auto;
    }
    .plain-text-result {
        display: block !important;
        border: none;
        padding: 0;
        margin: 0;
        font-size: 0.75rem;
        line-height: 1.3;
        page-break-inside: avoid;
    }
    .result-container > *:not(.plain-text-result) {
        display: none !important;
    }
    .export-options {
        display: none !important;
    }
    @page {
        size: auto;
        margin: 0;
    }
    body {
        margin: 0;
        padding: 0;
    }
}

.mobile-tools-container {
    display: none;
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

@media (max-width: 1024px) {
    .mobile-tools-container {
        display: block;
    }
    #related-tools {
        display: none;
    }
}

#calculateBtn {
    position: relative;
}

#calculateBtn .btn-text {
    transition: opacity 0.3s;
}

.breadcrumb {
    padding: 0px 10px;
    color: #000;
    margin-bottom: 5px;
    font-size: 1rem;
}

.breadcrumb a {
    color: #000;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

@media (max-width: 767px) {
    .container {
        padding-top: 0;
    }
    
    .calculator-container {
        padding-top: 0.75rem;
        margin-top: -20px;
    }
    
    h1 {
        font-size: 1.25rem;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding-top: 0.5rem;
    }
    
    .calculator-container {
        padding-top: 1rem;
        margin-top: -20px;
    }
}

.mobile-table {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #eee;
    border-radius: 8px;
}

.mobile-table table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.mobile-table th, .mobile-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    color: #000;
}

.mobile-table th {
    background-color: #4ecdc4;
    font-weight: bold;
    font-size: 1rem;
}

.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}