/* DIY Calculator UK — Shared Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #15803d;
    --primary-dark: #166534;
    --primary-light: #22c55e;
    --bg-light: #f0fdf4;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-mid: #475569;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
    --max-width: 1200px;
    --warning: #f59e0b;
    --info: #3b82f6;
    --error: #ef4444;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.7;
    background: var(--bg-light);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
/* Header */
header {
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo { font-size: 1.4rem; font-weight: 700; color: #fff; text-decoration: none; }
.logo span { color: #bbf7d0; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a { color: #dcfce7; font-size: 0.88rem; padding: 6px 10px; border-radius: 6px; transition: background 0.2s; text-decoration: none; }
.nav-links a:hover { background: rgba(255,255,255,0.15); color: #fff; text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; padding: 8px; }
/* Breadcrumb */
.breadcrumb { padding: 12px 0; font-size: 0.85rem; color: var(--text-light); }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 40px 20px;
}
.page-header .container { max-width: var(--max-width); }
.page-header h1 { font-size: 2rem; margin-bottom: 10px; line-height: 1.2; }
.page-header p { font-size: 1.05rem; opacity: 0.9; max-width: 700px; }
.updated-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}
/* Ad slots */
.ad-slot { display: none !important; margin: 24px 0; }
.ad-slot:has(ins[data-ad-status="filled"]) { display: block !important; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
ins.adsbygoogle:not([data-ad-status]) { display: none !important; }
/* Calculator Box */
.calculator-box {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    padding: 32px;
    margin: 24px 0;
}
.calculator-box h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--primary-dark);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-light);
}
.calc-grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.form-group { display: flex; flex-direction: column; }
.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-dark);
}
.form-group small {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 2px;
}
.form-group input,
.form-group select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,128,61,0.1);
}
.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.btn:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-lg { padding: 14px 36px; font-size: 1.05rem; }
/* Results Box */
.results-box {
    background: var(--bg-light);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 20px;
    display: none;
}
.results-box.visible { display: block; }
.results-box h3 {
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin-bottom: 16px;
}
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.result-item {
    background: var(--bg-white);
    padding: 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    text-align: center;
}
.result-item .label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 4px;
}
.result-item .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
}
.result-item .unit {
    font-size: 0.85rem;
    color: var(--text-mid);
}
.result-note {
    margin-top: 12px;
    padding: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #92400e;
}
/* Content Section */
.content-section {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius);
    margin: 24px 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.content-section h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--primary-dark);
}
.content-section h3 {
    font-size: 1.2rem;
    margin: 24px 0 10px;
    color: var(--text-dark);
}
.content-section p {
    margin-bottom: 14px;
    color: var(--text-mid);
}
.content-section ul, .content-section ol {
    margin: 10px 0 16px 24px;
    color: var(--text-mid);
}
.content-section li { margin-bottom: 6px; }
.content-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.content-section th, .content-section td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
}
.content-section th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}
.content-section td { color: var(--text-mid); }
/* Tip / Info Boxes */
.tip-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--info);
    padding: 16px 20px;
    border-radius: 0 6px 6px 0;
    margin: 16px 0;
    font-size: 0.95rem;
    color: #1e40af;
}
.warning-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid var(--warning);
    padding: 16px 20px;
    border-radius: 0 6px 6px 0;
    margin: 16px 0;
    font-size: 0.95rem;
    color: #92400e;
}
/* FAQ */
.faq-section { margin: 24px 0; }
.faq-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-question {
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dark);
    user-select: none;
}
.faq-question::after { content: "+"; font-size: 1.4rem; color: var(--primary); transition: transform 0.2s; min-width: 20px; text-align: center; }
.faq-question.active::after { content: "\2212"; }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: var(--text-mid);
    line-height: 1.7;
}
.faq-answer.open { max-height: 600px; padding-top: 12px; }
/* Internal Links Section */
.related-calculators {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius);
    margin: 24px 0;
    border: 1px solid var(--border);
}
.related-calculators h3 { font-size: 1.1rem; margin-bottom: 16px; color: var(--text-dark); }
.related-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.related-links a {
    padding: 10px 14px;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}
.related-links a:hover { background: #dcfce7; text-decoration: none; }
/* Footer */
footer {
    background: var(--text-dark);
    color: #cbd5e1;
    padding: 40px 20px;
    margin-top: 40px;
}
.footer-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}
.footer-col h3 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.footer-col a { color: #94a3b8; display: block; padding: 3px 0; font-size: 0.9rem; text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-col p { font-size: 0.85rem; color: #94a3b8; }
.footer-bottom {
    max-width: var(--max-width);
    margin: 30px auto 0;
    padding-top: 20px;
    border-top: 1px solid #334155;
    text-align: center;
    font-size: 0.85rem;
}
/* Responsive */
@media (max-width: 768px) {
    .page-header h1 { font-size: 1.6rem; }
    .page-header { padding: 30px 16px; }
    .calculator-box { padding: 20px 16px; }
    .calc-grid-form { grid-template-columns: 1fr; }
    .results-grid { grid-template-columns: 1fr 1fr; }
    .content-section { padding: 24px 16px; }
    .header-inner { padding: 0 16px; }
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .related-links { grid-template-columns: 1fr; }
    .content-section table { font-size: 0.82rem; }
    .content-section th, .content-section td { padding: 8px; }
}
@media (max-width: 480px) {
    .results-grid { grid-template-columns: 1fr; }
    .result-item .value { font-size: 1.3rem; }
}
