/* Styling for Kørselsfradrag Beregner Værktøj */
body{
}

.background{
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(100% 100% at 50% 100%, var(--bg-dark), var(--bg-dark2));
    z-index: -1;
}

.background .image{
    opacity: .5;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 256px;
    
    background-image: url("/img/tools/nature_bg.svg");
    background-repeat: repeat;
    background-size: auto 100%;
    background-position-x: center;
}

.koerselsfradrag .background .image{
    background-image: url("/img/tools/car_bg.svg");
}

.header.scrolled{
    position: sticky ;
    gap: 16px; 
    border: 2px solid var(--card-border50);
    background: var(--card-bg-top50); 
    box-shadow: inset 0 0 40px var(--card-bg-top), var(--shadow-low);
    min-width: calc(100% - 3rem);
}

.header .header-link{
    text-decoration: none; 
    text-align: center;
    font-size: 16px;
    font-family: 'Roboto Flex', sans-serif;
    font-weight: 400;
    color: var(--text-dark);
}

.header .logo-link .logo{
    height: 32px;
    margin: 16px 8px;
}

.desktop-only-nav
{
    width: fit-content;
}

.header .navigation:not(.desktop-only-nav)
{
    flex: unset;
    width: fit-content;
}

button.burger-menu-button{
    order: 0;
    display: flex;
}
    .mobile-top-actions{
        display: none !important;
    }

.header .actions{
    flex: 2 !important;
}

.mobile-nav-menu label {
    width: 90%;
    margin-top: 8px;
}

.dark-mode-text{
    display: unset;
}
.light-mode-text{
    display: none;
}

[data-theme='dark'] .dark-mode-text{
    display: none !important;
}
[data-theme='dark'] .light-mode-text{
    display: unset !important;
}

.mobile-nav-menu a:not(.default) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 90%;
    position: relative;
    margin: 2px 0;
    font-family: 'Roboto flex', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    border-radius: 12px;
    padding: 9px 16px;
}

.mobile-nav-menu a:not(.default) span{
    --size: 1.5rem;
    height: var(--size);
    min-height: var(--size);
    max-height: var(--size);
    width: var(--size);
    min-width: var(--size);
    max-width: var(--size);
    border-radius: 4px;
    background: var(--bg-dark);
    color: var(--primary);
    font-size: calc(var(--size) * 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -0.45rem;
}

.mobile-nav-menu a:not(.default).free::after{
    content: "Gratis";
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 12px;
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 8px;
    color: var(--text-light);
    pointer-events: none;
}

.mobile-nav-menu a.login{
    border-bottom: var(--b) solid var(--bg-dark2);
    --el-gradient-color-1: var(--card-bg-top);
    --el-gradient-color-2: var(--bg-darker);
    color: var(--text-dark-accent);
    box-shadow: inset 0 0 16px -4px var(--card-bg-top);
}

.mobile-nav-menu a.login:hover,
.mobile-nav-menu a.login:focus{
    color: var(--primary);
}

.mobile-nav-menu .actions {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
    margin: 12px 0 4px;
}
.mobile-nav-menu .actions a{
    margin: 0;
}

.mobile-nav-menu .sep {
    height: 1px;
    background: var(--bg-dark);
    width: 80%;
    margin: 8px 0;
}

#dynamic-tool-links  {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

#dynamic-tool-links label {
    margin-left: 16px;
}

/* Main layout and hero section */
.tool-main-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    padding-top: 32px; /* Space below sticky header */ 
}

.tool-hero {
    text-align: center;
    max-width: var(--context-width);
    width: calc(100% - 32px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 16px;
    max-width: 70rem;
    color: var(--text-dark-accent);
}

.tool-hero .subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-dark);
    max-width: 700px;
    margin: 0 auto;
}

/* The Calculator Card */
.calculator-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.calculator-card {
    width: 100%;
    max-width: min(750px, calc(100% - 64px));
    background: var(--card-bg-top);
    padding: 32px;
    border-radius: 40px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-large);
}

.calculator-card form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-weight: 400;
    font-size: 0.9rem;
    margin: 0 8px;
    font-family: var(--font-body);
    color: var(--text-dark-accent);
}

.input-group input,
fieldset input {
    font-family: 'Roboto Flex', sans-serif;
    font-size: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    background: var(--bg);
    color: var(--text-dark); 
    transition: all 0.2s ease;
}

.input-group input:focus,
fieldset input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary20);
}

.calculator-card .row {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

.calculator-card .row .input-group {
    flex: 1;
}

.calculator-card button#calculateButton {
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    align-self: center;
}

.error-message {
    color: var(--warning);
    font-weight: 500;
    text-align: center;
    min-height: 1.2em;
}

/* Results Area */
.results-container {
    margin-top: 2rem;
    border-top: 1px solid var(--card-border); 
    scroll-margin-top: 60px;
}

.results-container h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.result-box {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item .label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark-mute);
}

.result-item .value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
}

.result-item.accent .value {
    color: var(--primary);
    font-size: 2.2rem;
}

.disclaimer {
    font-size: 0.8rem;
    color: var(--text-dark-mute);
    text-align: center;
    margin-top: 1.5rem;
}

/* Yderkommune Notice Box */
.notice-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--primary10);
    border: 1px solid var(--primary40);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.notice-box .material-icons-round {
    color: var(--primary);
    font-size: 2rem;
}

.notice-box p {
    margin: 0;
    color: var(--text-dark);
}

/* Prose and FAQ section */
.prose-section {
    background: var(--card-bg-top);
    width: fit-content;
    margin:  0 auto;
    padding: 16px 64px 64px;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    border-radius: 64px;
}

.prose-section article,
.prose-section aside {
    max-width: 800px;
    width: 100%;
}

.prose-section article h2, .faq-section h2 {
    margin-top: 2.5rem; 
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    font-weight: 900; 
    font-size: 36px;
    color: var(--text-dark-accent);
}

.prose-section p, .prose-section li {
    line-height: 1.7;
    font-size: 1.1rem;
    color: var(--text-dark80);
}

.prose-section ul {
    list-style-type: '✓ ';
    padding-left: 1.5rem;
}

.prose-section li {
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.faq-section {
    margin-top: 3rem;
}

.faq-section details {
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 0;
}
.faq-section details:last-of-type {
    border-bottom: none;
}

.faq-section summary {
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none; /* Hide default arrow */
    position: relative;
    padding-right: 2rem;
}

.faq-section summary::after {
    content: '+';
    font-family: 'Montserrat', sans-serif;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    font-size: 1.5rem;
    color: var(--primary);
}

.faq-section details[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-section details p {
    margin-top: 1rem;
    padding-left: 0.5rem;
}

/* CTA section */
.cta-section {
    width: 100%;
    background: var(--primary-gradient-color);
    padding: 4rem 1rem;
    margin-top: 2rem;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.cta-content h2, .cta-content p {
    color: var(--text-light);
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cta-content p {
    font-size: 1.1rem;
    max-width: 600px;
}

.cta-content .primary-link {
    background: var(--default);
    color: var(--primary);
    border-bottom: 3px solid #d0e3ff;
}

[data-theme='dark'] .cta-content .primary-link {
    background: var(--card-bg-dark);
    color: var(--text-light-accent);
}

.callback{
    --m: 1rem;
    --p: 2rem;
    width: calc(100% - (2 * var(--m)) - (2 * var(--p)));
    padding: var(--p);
    margin: var(--m) 0;
    max-width: 864px;
    
    border-radius: 64px;
    height: fit-content;
    background: var(--primary);
    background-image: radial-gradient(85% 100% at 50% 100%, var(--primary-light), transparent);
    box-shadow: inset 0 0 30vmin -0.5vmin var(--bg-dark);
    display: flex;
    flex-direction: row;
    gap: 32px;
}

.callback .content{
    flex: 1; 
    padding: 32px;
    padding-bottom: 0;
}
.callback .content h2{
    margin-top: 0;
    font-weight: 900;
    color: var(--text-light);
    font-size: 32px;
    line-height: 100%;
} 

.callback .content p{
    color: var(--text-light);
}

.callback .images{
    position: relative;
    width: 256px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.callback .images img{
    position: absolute;
    height: 140%;
    bottom: 0;
    transform: rotate(0deg) scale(1) translateX(0px);
    z-index: 1;
    filter: drop-shadow(rgba(0, 0, 0, 0.3) 0px 8px 10px);
}

.callback .images .app-roster{
    transform: rotate(-10deg) scale(0.8) translate(-99px, -25px);
    z-index: 0;
    filter: drop-shadow(rgba(0, 0, 0, 0.3) 0px 2px 5px);
}

.callback .cta{
    margin-left: auto;
    box-shadow: inset 0 0 2rem -4px var(--card-bg-top);
    backdrop-filter: blur(10px);
    opacity: 1;
    background: var(--card-bg50);
    padding: 12px 12px 4px;
    border-radius: 25px;
    border: .1rem solid var(--card-bg);
    width: fit-content;
    display: flex;
    flex-direction: column;
}

.callback .cta label{
    width: 100%;
    font-weight: 400;
    font-family: 'Roboto Flex', sans-serif;
    text-align: center;
    margin:  1px auto 0;
    font-size: 10px;
    color: var(--text-dark-mute);   
}

.footer-section{
    min-height: unset;
}

@media (max-width: 800px) {
    .mobile-top-actions{
        display: flex !important;
    }
    button.burger-menu-button{
        order: 1;
    }
    .mobile-nav-menu{
        left: unset;
        right: 8px;
    }
}

@media (max-width: 900px) {
    .callback .images img{ 
        height: 130%; 
    } 
    .callback .images{
        min-width: 256px; 
    }
}

/* Add these new styles to your /css/tool.css file */

/* --- Mode Switcher --- */
.mode-switcher {
    display: flex;
    background-color: var(--bg);
    border-radius: 0.75rem;
    padding: 0.25rem;
    border: 1px solid var(--card-border);
    margin-bottom: 1rem;
}

.switch-label {
    flex: 1;
    position: relative;
    display: inline-block;
}

.switch-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-text {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark-mute);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.switch-label input[type="radio"]:checked + .mode-text {
    background-color: var(--card-bg-dark);
    color: var(--text-light-accent);
    box-shadow: 0 2px 10px -2px var(--shadow-color-15);
}
[data-theme='light'] .switch-label input[type="radio"]:checked + .mode-text {
     background-color: var(--default);
     color: var(--primary);
}


/* --- Input Field State Control --- */
.address-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.5s ease;
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
    overflow: hidden;
}

.distance-input {
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.5s ease;
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
}

/* Style for when distance mode is active */
.distance-mode .address-inputs {
    opacity: 0;
    max-height: 0;
    pointer-events: none;
    margin: -1.5rem 0; /* Collapse the margin */
}

.distance-mode .distance-input input {
    border-color: var(--primary);
}


/* Style for when address mode is active */
.address-mode .distance-input {
    opacity: 0.5;
    pointer-events: none;
}
.address-mode .distance-input input {
    background-color: var(--bg-mute);
}


/* --- Loader and Spinner --- */
.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    text-align: center;
    border-radius: 0.5rem;
}

.loader span {
    font-weight: 500;
    color: var(--text-dark);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--primary20);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* Make sure the calculate button is hidden when the loader is active */
#calculateButton[style*="display: none"] {
    display: none !important;
}

/* Ensure form layout remains consistent when button is hidden */
#deductionForm {
    position: relative;
}


/* --- Tooltips --- */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    vertical-align: middle;
}
.tooltip-container .material-icons-round {
    font-size: 1.1rem;
    color: var(--text-dark-mute);
    cursor: help;
}
.tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: var(--card-bg-dark);
    color: var(--text-light);
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 10;
    bottom: 150%;
    left: 50%;
    margin-left: -110px; /* Use half of the width to center */
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: 400;
    font-size: 0.85rem;
    box-shadow: var(--shadow-medium);
}
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--card-bg-dark) transparent transparent transparent;
}
.tooltip-container:hover .tooltip-text,
.tooltip-container:focus-within .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* --- Advanced Day Calculator --- */
.advanced-day-calculator {
    margin-top: -1.2rem;
    margin-bottom: 0.5rem;
}
.advanced-day-calculator summary {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    list-style: none; /* Hide default arrow */
    padding: 0 0 0.5rem;
    text-align: right;
    font-size: 0.9rem;
}
.advanced-day-calculator summary::-webkit-details-marker {
  display: none;
}
.advanced-day-calculator .details-content {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg);
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
}
.day-calc-result {
    font-weight: 600;
    color: var(--text-dark-accent);
    align-self: center;
}

/* --- Bridge Tolls --- */
.bridge-tolls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-mute);
    border-radius: 0.75rem;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}
.checkbox-label input[type="checkbox"] {
    width: 1.15em;
    height: 1.15em;
    accent-color: var(--primary);
}


/* --- Result Breakdown --- */
.result-breakdown {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}
.result-breakdown h4 {
    margin-bottom: 1rem;
    text-align: center;
}
.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}
.breakdown-row .label {
    color: var(--text-dark-mute);
}
.breakdown-row .value {
    font-weight: 600;
    color: var(--text-dark);
}

/* --- Styling for Select Dropdowns --- */
.input-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: 'Roboto Flex', sans-serif;
    font-size: 1rem;
    padding: 0.8rem 1rem;
    padding-right: 2.5rem; /* Make space for the arrow */
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    background-color: var(--bg);
    color: var(--text-dark);
    width: 100%;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    transition: all 0.2s ease;
}

[data-theme='dark'] .input-select {
     background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

.input-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary20);
}

/* --- Styling for Tab Content --- */
.tab-pane {
    display: none;
    animation: fadeIn 0.5s;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Small Notice Box --- */
.notice-box-small {
    font-size: 0.85rem;
    text-align: center;
    padding: 0.75rem;
    background-color: var(--bg-mute);
    border-radius: 0.5rem;
    margin: 1rem 0;
    color: var(--text-dark-mute);
}

/* --- Print Button --- */
#printButton {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem auto 0;
    background: var(--element-bg);
    color: var(--text-dark);
    border: 1px solid var(--card-border);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}
#printButton:hover {
    background-color: var(--card-border);
}

/*
=====================================================
== STYLES FOR FAKTURAGENERATOR VÆRKTØJ
=====================================================
*/

/* --- Grundlæggende Layout --- */
.fakturagenerator-tool .tool-hero {
    max-width: 100%;
}

.invoice-wrapper {
    --brand-hue: 215; /* Default hue */
    --brand-color: hsl(var(--brand-hue), 100%, 47%);
    --brand-color-light: hsl(var(--brand-hue),  89%, 96%);
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    align-items: flex-start;
}

.invoice-controls {
    flex: 1;
    min-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 0;
    background-color: var(--bg-dark);
    padding: 16px;
    border-radius: 32px;
}

[data-theme="dark"] .invoice-controls {
    background-color: var(--card-bg-top);
}

.invoice-preview-container {
    flex: 1.5;
    min-width: 600px;
    position: sticky;
    top: 100px; /* Adjust based on your header height */
    height: fit-content;
    max-height: calc(100vh - 120px); 
    padding-right: 1rem;
}


/* --- Venstre Panel: Kontrol-elementer --- */
.invoice-controls fieldset {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 1.5rem;
    border-radius: 1rem;
    overflow: hidden;
    max-width: 100%;
}

.invoice-controls fieldset .row{
    display: flex;
    gap: inherit;
}

.company{
    background-color: var(--bg-darker);
}

.invoice-controls fieldset input:not([type="checkbox"]){
    flex: 1;
}

.invoice-controls .fieldset-title {
    font-weight: 900;
    font-size: 1.1rem;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark-accent);
}

.invoice-controls .row {
    gap: 1rem;
}

.line-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.line-item .line-description { flex: 4; }
.line-item .line-qty,
.line-item .line-unit,
.line-item .line-rate {
    flex: 1;
    min-width: 60px;
}

.remove-line-item {
    background: transparent;
    border: none;
    color: var(--text-dark-mute);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0 0.5rem;
    line-height: 1;
    border-radius: 50%;
}
.remove-line-item:hover {
    color: var(--warning);
    background-color: var(--warning10);
}

.small-button {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    align-items: flex-start;
}
.form-actions .primary, .form-actions .secondary-link {
    width: 100%;
    justify-content: center;
    margin: 0 !important;
    padding: 1rem 1.4rem !important;  
}

.privacy-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dark-mute);
    margin-top: 1rem;
}

/* --- Fieldset Collapse --- */
.invoice-controls fieldset {
    border: none;
    padding: 1rem 0.5rem;
    margin: 0;
    overflow: hidden; 
}

.fieldset-title {
    font-weight: 900 !important;
    font-size: 1.1rem;
    padding: 0.5rem;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
    border-radius: 0.5rem;
}

.fieldset-title:hover {
    background-color: var(--bg-darker);
}

.fieldset-icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease-out;
}
.fieldset-icon-container .material-icons-round {
    display: none; 
    font-size: 24px;
}

fieldset.is-active .icon-open { display: inline-block; }
fieldset:not(.is-active):not(.is-complete) .icon-closed { display: inline-block; }
fieldset:not(.is-active).is-complete .icon-complete { display: inline-block; }

fieldset.is-active .fieldset-title { color: var(--text-dark-accent); }
fieldset.is-complete .fieldset-title { color: var(--success); }
fieldset:not(.is-active) .fieldset-icon-container { transform: rotate(-90deg); }
fieldset.is-active .fieldset-icon-container { transform: rotate(0deg); }
fieldset.is-complete:not(.is-active) .fieldset-icon-container { transform: rotate(0deg); }

.fieldset-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    max-height: 1000px;
    opacity: 1;
    transition: max-height 0.5s ease-in-out, opacity 0.4s ease-in-out, padding-top 0.5s ease, padding-bottom 0.5s ease;
    overflow: hidden;
}

fieldset:not(.is-active) .fieldset-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}


fieldset:not(.is-active) .fieldset-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
}


/* --- Nyt Line Item Layout --- */
#line-items-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.line-item-card {
    background: var(--bg-darker);
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid var(--card-border);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.line-item-card .line-description {
    width: auto;
}

.line-item-details {
    display: flex;
    gap: 4px;
    align-items: center;
}

.line-item-details .input-group{
    flex: 1; 
    position: relative;
}

.line-item-details .input-group input{
    width: 100%;
    box-sizing: border-box;
}

.line-item-actions {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.invoice-controls .advanced-day-calculator{
    margin-top: 0;
}

/* --- Højre Panel: Invoice Preview --- */
#invoice-preview {
    z-index: 0;
    position: relative;
    background: #fff;
    padding: 2.5rem;
    box-shadow: var(--shadow-float),var(--shadow-large);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #1a1a1a;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    overflow: hidden;
}
[data-theme='dark'] #invoice-preview {
    border: 1px solid var(--card-border);
}

#invoice-preview::before{
    content: " ";
    z-index: -1;
    width: 100%;
    height: 160px;
    position: absolute;
    top: 0;
    left: 0;
    background: var(--brand-color-light);
}

#invoice-preview section {
    margin: 0;
    width: unset;
    flex-direction: row;
}

.invoice-header {
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.invoice-header-sender{
    display: flex;
    flex-direction: row;
    gap: 16px;
}

.company-details {
    font-size: 0.9rem;
    line-height: 1.5;
}
.company-details strong {
    font-size: 1rem;
    font-weight: 900;
    font-family: 'Montserrat','Helvetica Neue', Arial, sans-serif;
}

#preview-doc-title {
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 0.1rem;
    color: var(--brand-color);
    margin: 0;
    flex: 1;
    text-align: right;
    line-height: 1;
    font-weight: 900;
    font-family: 'Montserrat','Helvetica Neue', Arial, sans-serif;
}

.invoice-meta {
    display: flex;
    flex-direction: row;
    width: unset;
    justify-content: space-between;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    line-height: 1.6;
}
.invoice-dates-numbers {
    text-align: right;
}

.line-items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    z-index: 5;
}

.line-items-table thead{
    position: relative;
    z-index: 1;
}
.line-items-table thead::before{
    content: " ";
    height: 100%;
    width: calc(100% + 16px);
    position: absolute;
    top: 0;
    left: -8px;
    background: var(--brand-color-light);
    border-radius: 8px;
    overflow: hidden;
    z-index: -1;
}

.line-items-table th {
    text-align: left;
    padding: 0.75rem; 
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    z-index: 5;
}
.line-items-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--brand-color-light);
    vertical-align: top;
    font-size: 0.95rem;
}
.line-items-table th:last-child,
.line-items-table td:last-child,
.text-right {
    text-align: right;
}

#invoice-preview .invoice-summary {
    width: 50%;
    margin-left: auto; 
    align-items: unset;
    justify-content: unset;
    flex-direction: column;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-size: 0.95rem;
}
.summary-item:not(.total) {
     border-bottom: 1px solid var(--brand-color-light);
}
.summary-item strong {
    font-weight: 800;
    font-family: 'Montserrat','Helvetica Neue', Arial, sans-serif;
}
.summary-item.total {
    position: relative;
    margin-top: 8px;
    padding-top: 16px; 
    font-size: 22px;
    color: var(--brand-color);
    z-index: 1;
}


.summary-item.total::before{
    position: absolute;
    content: " ";
    border-radius: 16px;
    top: 3px;
    left: -20px;
    height: 100%;
    min-height: 100%;
    max-height: 100%;
    width: calc(100% + 40px);
    background: var(--brand-color-light);
    z-index: -1;
}

#invoice-preview .invoice-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--brand-color-light);
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    width: 100%;
    flex-direction: column;
}
.footer-notes p {
    margin-top: 1rem;
    white-space: pre-wrap; /* Respects newlines in the textarea */
}

.invoice-footer .payment-info{
    text-align: center;
}

.powerplan-branding {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: #aaa;
}

.powerplan-branding img{
    position: absolute;
    left: 32px;
    bottom: 32px;
    height: 32px;
}

/* --- NEW: Print Preview Modal --- */
.print-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); 
    z-index: 1000;
}

.print-modal-content {
    top: 10vh;
    left: 5%;
    position: sticky;
    background-color: #fff;
    width: 90%;
    height: 80vh;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.print-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #ddd;
}

.print-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.print-modal-close-btn {
    font-size: 1.5rem;
    font-weight: bold;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.print-modal-body {
    flex-grow: 1;
    overflow: hidden; /* The iframe will handle its own scroll */
}

.print-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Diverse Kontrol-elementer --- */
textarea#notes {
    font-family: 'Roboto Flex', sans-serif;
    font-size: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    background: var(--bg);
    color: var(--text-dark);
    transition: all 0.2s ease;
    min-height: 80px;
    resize: vertical;
}
textarea#notes:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary20);
}

.small-button {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
}
.form-actions {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0.5rem 0;
}
.form-actions .primary, .form-actions .secondary-link {
    width: 100%;
    justify-content: center;
}
.privacy-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dark-mute);
    margin: 1rem 0.5rem 0;
}

/* --- NEW: Branding Features CSS --- */

/* Hue Slider Component */
.c-range {
    position: relative;
    padding: 5px 0;
}
.c-range__holder {
    display: flex;
    align-items: center;
    position: relative;
}
.c-range__slider {
    width: 100%;
    margin: 0;
    padding: 0;
    min-height: 24px;
    background: transparent;
    outline: none;
    cursor: pointer;
}
.c-range__slider, .c-range__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
}
.c-range__slider::-webkit-slider-runnable-track {
    border: none;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}
.c-range__slider::-moz-range-track {
    border: none;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}
.c-range__slider::-webkit-slider-thumb {
    margin-top: -10px;
    border: 4px solid white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand-color);
    box-shadow: 0 0 0 1px rgba(0,0,0,.025), 0 1px 5px rgba(0, 0, 0, 0.25);
}
.c-range__slider::-moz-range-thumb {
    border: 4px solid white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand-color);
    box-shadow: 0 0 0 1px rgba(0,0,0,.025), 0 1px 5px rgba(0, 0, 0, 0.25);
}

#preview-logo {
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
}
.company-details {
    flex: 1;
    text-align: left;
} 

.c-range__output {
    opacity: 0;
    position: absolute;
    width: 48px;
    top: -36px;
    padding: 4px;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    border-radius: 4px;
    background-color: #333;
    color: white;
    transition: opacity 0.1s ease-out;
    pointer-events: none; 
}

.c-range__output::before {
    content: "";
    display: block;
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4px 4px 0 4px;
    border-color: #333 transparent transparent transparent;
}

.c-range__slider:focus + .c-range__output,
.c-range__slider:active + .c-range__output {
    opacity: 1;
}

.file-drop-area {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px;
    border: 2px dashed var(--bg-dark2-50);
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    text-align: center;
    color: #666;
}

.file-drop-area .material-icons-round {
    font-size: 28px;
    opacity: 0.8;
}

.file-drop-area:hover {
    border-color: hsl(var(--brand-hue, 215), 100%, 47%);
    background-color: hsl(var(--brand-hue, 215), 89%, 97%);
}
 
.file-drop-area.drag-over {
    border-color: var(--brand-color);
    border-style: solid;
    background-color: var(--brand-color-light);
} 

.file-drop-area { 
    position: relative; 
    padding: 12px;
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.file-prompt{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.logo-preview-img {
    max-width: 80%;
    max-height: 100px;
    object-fit: contain;
}

.clear-logo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.file-drop-area:hover .clear-logo-btn {
    opacity: 1;
}

#preview-logo-container.is-loading {
    display: block; 
    background-color: #eef1f4;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 80px; /* Should match your logo's max-height */
}

#preview-logo-container.is-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%; 
    width: 150%;
    height: 100%; 
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}
 
@media (max-width: 1200px) {
    .invoice-wrapper {
        flex-direction: column;
        gap: 2rem;
    }
    .invoice-controls, .invoice-preview-container {
        min-width: 100%;
    }
    .invoice-preview-container {
        position: static;
        height: auto;
        overflow-y: visible;
        padding-right: 0;
    }
}

/* --- Print Styles --- */
@media print { 
    body > *:not(.tool-main-content),
    .tool-main-content > *:not(.invoice-wrapper),
    .invoice-wrapper > *:not(.invoice-preview-container),
    .prose-section,
    .form-actions {
        display: none !important;
    }
 
    .invoice-preview-container, 
    #invoice-preview {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important; 
        overflow: visible !important;
    }
    
    #invoice-preview {
        font-size: 10pt;
        border-radius: 0 !important;
    }
    #preview-doc-title {
        color: var(--brand-color) !important;
    }

    .line-items-table th {
        background-color: var(--brand-color-light) !important;
        -webkit-print-color-adjust: exact; /* For Chrome/Safari */
        color-adjust: exact; /* Standard */
    }

    a {
      text-decoration: none;
      color: inherit;
    }
}

/* --- 2026 Rule Checker Styles --- */
.checker-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--card-border);
}

.checker-step {
    animation: fadeIn 0.3s ease-in-out;
}

.checker-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.checker-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.8rem;
    border: 1px solid var(--card-border);
    background: var(--bg);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s;
    text-align: center;
}

.checker-btn:hover {
    background: var(--bg-mute);
    border-color: var(--primary40);
}

.checker-btn.selected {
    background: var(--primary10);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}

.checker-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 1rem;
    background: var(--bg-mute);
    border-left: 5px solid var(--text-dark-mute);
}

.checker-result.liable {
    background: #fff4f4;
    border-left-color: var(--warning);
}
[data-theme='dark'] .checker-result.liable { background: #3c1e1e; }

.checker-result.exempt {
    background: #f0fdf4;
    border-left-color: var(--primary);
}
[data-theme='dark'] .checker-result.exempt { background: #132e1e; }

.checker-result h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Custom Dropdown & Search --- */
.custom-dropdown-container {
    position: relative;
    width: 100%;
}

.dropdown-selected {
    background: var(--bg);
    border: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    font-family: 'Roboto Flex', sans-serif;
    color: var(--text-dark);
}

.dropdown-selected:after {
    content: '▼';
    font-size: 0.8em;
    color: var(--text-dark-mute);
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg-top);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-medium);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.dropdown-list.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-search {
    padding: 12px;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    background: var(--card-bg-top);
    z-index: 10;
    box-sizing: border-box;
}

.dropdown-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text-dark);
    box-sizing: border-box;
}

.dropdown-group-label {
    padding: 8px 16px;
    background: var(--card-bg-top);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 55px; /* Height of search input */
}

.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.1s;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
}

.dropdown-item:hover {
    background: var(--primary10);
}

.dropdown-item .tax-info {
    font-size: 0.85em;
    color: var(--text-dark-mute);
}

/* --- Year Switcher Specifics --- */
.year-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.year-selector label {
    cursor: pointer;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--primary50);
    background: var(--primary10);
    color: var(--text-dark-mute);
    font-weight: 600;
    transition: all 0.2s ease;
}
.year-selector label:first-of-type {
    border-radius: 8px 0 0 8px;
    border-right: none;
}
.year-selector label:last-of-type {
    border-radius: 0 8px 8px 0;
    border-left: none;
}
.year-selector input[type="radio"] {
    display: none;
}
.year-selector input:checked + span {
    color: var(--primary);
}
.year-selector label:has(input:checked) {
    border:1px solid var(--primary);
    background: var(--card-bg);
    z-index: 1;
    box-shadow: inset 0 0 16px var(--primary20);
}