* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.34;
    color: #111827;
    background: #fff;
}

/* Navigation - Darker */
.navbar {
    background: #155e75;
    padding: 10px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
}

.nav-brand {
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-brand:hover {
    opacity: 0.9;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.nav-menu li {
    display: flex;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0px 16px;
    font-size: 15px;
    font-weight: 500;
    display: inline-block;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Breadcrumb */
.breadcrumb {
    padding: 6px 0;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.breadcrumb-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #4b5563;
}

.breadcrumb-nav a {
    color: #0e7490;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
    color: #155e75;
}

.breadcrumb-nav .separator {
    margin: 0 6px;
    color: #9ca3af;
}

.breadcrumb-nav .current {
    color: #1f2937;
    font-weight: 500;
}

/* Main Layout */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 8px 15px;
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 20px;
}

/* Content Area */
.content {
    background: white;
}

h1 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #111827;
}

h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 20px 0 10px 0;
    color: #111827;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 15px 0 8px 0;
    color: #1f2937;
}

p {
    font-size: 16px;
    margin-bottom: 12px;
    color: #374151;
}

ul {
    margin-left: 25px;
    margin-bottom: 12px;
}

li {
    margin-bottom: 4px;
    line-height: 1.6;
    color: #374151;
}

/* Calculator Tabs */
.calculator-tabs {
    display: flex;
    justify-content: flex-start;
    background: transparent;
    border-bottom: 1px solid #d1d5db;
    gap: 8px;
    margin-bottom: -15px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 8px 15px;
    background: #d1d5db;
    border: 1px solid #9ca3af;
    border-bottom: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #374151;
    border-radius: 6px 6px 0 0;
    position: relative;
    margin-bottom: -2px;
}

.tab-button:hover {
    background: #e5e7eb;
    color: #111827;
}

.tab-button.active {
    background: #f0f8f8;
    color: #155e75;
    border-color: #d1d5db;
    border-bottom: none;
    font-weight: 600;
    z-index: 1;
}

/* Calculator Box */
.calc-box {
    border-radius: 6px;
    background: #f0f8f8;
    padding: 20px;
    margin: 15px 0;
    border: 1px solid #e5e7eb;
}

.calculator-tabs + .calc-box {
    border-radius: 0 0 6px 6px;
    border-top: none;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    gap: 10px;
}

.label {
    font-size: 16px;
    min-width: 70px;
    text-align: right;
    color: #1f2937;
}

.calc-input {
    width: 160px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 16px;
    background: white;
}

.calc-input:focus {
    outline: none;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.calc-select {
    width: 160px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.calc-select:focus {
    outline: none;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.unit-text {
    font-size: 18px;
    min-width: 100px;
    color: #374151;
}

.button-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.btn {
    font-size: 16px;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    background-color: #0891b2;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background-color: #0e7490;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.btn-copy {
    background-color: #374151;
}

.btn-copy:hover {
    background-color: #1f2937;
}

.result-area {
    margin-top: 15px;
    text-align: center;
    font-size: 18px;
    min-height: 35px;
    color: #1f2937;
}

.result-area strong,
.result-area b {
    color: #d97706;
    font-weight: 700;
}

.round-control {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    color: #374151;
}

.round-select {
    width: 130px;
    padding: 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

/* List styling */
.list-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    list-style: disc outside;
    margin: 12px 0 12px 1.3em;
    padding: 0;
}

.list-grid li {
    margin: 0;
    padding: 0;
}

.list-grid a {
    color: #0e7490;
    text-decoration: none;
    font-weight: 500;
}

.list-grid a:hover {
    color: #155e75;
    text-decoration: underline;
}

.allunits {
    list-style: disc outside;
    margin: 8px 0 12px 1.3em;
    padding: 0;
}

.allunits li {
    margin: 2px 0;
    padding: 2px 0;
}

.allunits li div {
    padding-left: 5px;
}

.allunits li div a {
    color: #0e7490;
    text-decoration: none;
    font-weight: 500;
}

.allunits li div a:hover {
    color: #155e75;
    text-decoration: underline;
}

/* Formula Box */
.formula-box {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    padding: 15px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
}

th {
    background: #1f2937;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

tr:nth-child(even) {
    background: #f9fafb;
}

tr:hover {
    background: #ecfeff;
}

/* Sidebar */
.sidebar-card {
    background: #fff;
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    background: #1f2937;
    color: white;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 16px;
}

.sidebar-content {
    padding: 4px 15px;
}

.sidebar-content ul {
    list-style: none;
    margin: 0;
}

.sidebar-content li {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.sidebar-content li:last-child {
    border-bottom: none;
}

.sidebar-content a {
    color: #0e7490;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

.sidebar-content a:hover {
    text-decoration: underline;
    color: #155e75;
}

/* Error/Alert */
.error {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    color: #991b1b;
    font-weight: 500;
}

.hidden {
    display: none;
}

/* Footer */
.footer {
    background: #1f2937;
    color: #f3f4f6;
    padding: 20px 15px 10px;
    margin-top: 20px;
}

.footer p {
    color: #f3f4f6;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .navbar {
        height: 45px;
    }

    .nav-brand {
        font-size: 16px;
    }

    .nav-menu {
        display: none;
    }

    .main-container {
        grid-template-columns: 1fr;
        padding: 15px 10px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 18px;
    }

    .calc-input,
    .calc-select {
        width: 48%;
        max-width: 160px;
    }

    .label {
        display: none;
    }

    .breadcrumb-nav {
        font-size: 12px;
    }
    
    .list-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mobile tabs - equal width with better font size */
    .calculator-tabs {
        gap: 4px;
    }
    
    .tab-button {
        flex: 1;
        min-width: 0;
        padding: 10px 8px;
        font-size: 15px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .tab-button {
        font-size: 14px;
        padding: 10px 6px;
    }
}