body {
    font-family: 'Fira Sans', sans-serif;
    margin: 1.5rem auto;
    /* relative to font size */
    max-width: 2160px;
    padding: 0 1.5rem;
}

.section-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.section-divider {
    border: none;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 14px 0;
}

.window-title {
    margin-top: 18px;
    /* 👈 this creates clean separation */
}

#mobileContainer.mobile-mode {
    width: 400px;
    height: 700px;
    /* typical phone height */
    max-width: 100%;
    max-height: 100vh;
    margin: 20px auto;
    font-size: 14px;
    border: 16px solid #333;
    border-radius: 36px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: #fff;
    position: relative;

    /* NEW */
    display: block;
    /* don’t use flex */
    overflow-y: auto;
    /* single scrollbar for all content */
    box-sizing: border-box;
    /* include border in size */
    padding: 10px;
    /* optional padding inside the frame */
}

/* Remove previous rule */
#mobileContainer.mobile-mode>* {
    height: auto;
    /* let children grow naturally */
    overflow: visible;
    /* no separate scroll */
}

.title-text {
    text-align: center;
}


.title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* title left/center + logo right */
    margin-bottom: 16px;
    flex-wrap: wrap;
    /* allows wrapping on small screens */
}

#title {
    flex: 1;
    /* takes remaining space */
    text-align: center;
}

.title-logo {
    width: auto;
    max-width: 160px;
    /* limits size on large screens */
    height: auto;
}

/* Hide small logo by default */
.title-logo-small {
    display: none;
    height: 1em;
    width: auto;
    margin-left: 0.45rem;
}

/* When “small-logo” class is active (forced) */
.title-wrap.small-logo .title-logo {
    display: none;
}

.title-wrap.small-logo .title-logo-small {
    display: inline-block;
}

/* Big logo is hidden on small screens */
@media (max-width: 650px) {
    .title-logo {
        display: none;
    }

    .title-logo-small {
        display: inline-block;
        /* show inline with text */
    }
}

.project-name {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.title-refresh {
    display: inline-flex;
    align-items: center;
}

.title-icon {
    height: 1em;
    width: auto;
    display: block;
}

.project-tagline {
    margin: 0.3rem 0 0 0;
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    font-weight: 400;
    opacity: 0.75;
    /* makes it less dominant */
}

/* Default: hidden (browser does this automatically) */


#loading {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    border: none;
    outline: none;
    /* <-- wichtig */
    box-shadow: none;
    /* <-- wichtig */
    padding: 0;
    margin: 0;
    /* <-- wichtig */
    background: transparent;
}

/* Only when dialog is open, make it flex + center logo */
#loading[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Darkened background for modal */
#loading::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

/* Logo animation */
.animatedLogo {
    width: 400px;
    /* adjust as needed */
    max-width: 80vw;
    filter: grayscale(100%);
    animation: colorShift 2s infinite;
}

/* Static text below the logo */
.loadingText {
    font-size: 1.5rem;
    /* adjust size */
    font-weight: bold;
    color: rgb(172, 171, 171);
    /* static color */
    text-align: center;
}

/* Animation keyframes */
@keyframes colorShift {
    0% {
        filter: grayscale(100%);
    }

    25% {
        filter: grayscale(75%);
    }

    50% {
        filter: grayscale(0%);
    }

    75% {
        filter: grayscale(75%);
    }

    100% {
        filter: grayscale(100%);
    }
}

/* Expert button */
.icon-button {
    width: 24px;
    height: 24px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    /* needed for tooltip */
}

.icon-button:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

#downloadXmlBtn {
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: #2c7a4b;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#downloadXmlBtn:hover:not(:disabled) {
    background-color: #256b40;
}

#downloadXmlBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#simulateFieldBtn {
    margin-top: 16px;
    /* Abstand zwischen den beiden Buttons */
}

/* Expert parameters hidden by default */
.expert-params {
    display: none;
    margin-top: 12px;
    position: relative;
    /* needed for tooltip positioning */
}


.card {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.row {
    display: flex;
    /* keep items in a row */
    gap: 12px;
    /* horizontal spacing between items */
    flex-wrap: wrap;
    /* wrap to new line if needed */
    align-items: center;
    /* vertically center label/input */
    margin-top: 12px;
    /* vertical spacing between rows */
}

.ui-warning {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgb(36, 128, 124);
    background: #f7f7f7;
    font-weight: 500;
}

.card.collapsible {
    padding: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    user-select: none;
}

/* Wrap buttons in a container (optional but cleaner) */
.card-header .button-group {
    display: flex;
    gap: 6px;
    /* space between buttons */
}

.card-header h3 {
    margin: 0;
}

.card-content {
    padding: 16px;
    border-top: 1px solid #eee;
}

.card.collapsed .card-content {
    display: none;
}

.chevron {
    transition: transform 0.2s ease;
}

.card.collapsed .chevron {
    transform: rotate(-90deg);
}

button,
.custom-file-btn {
    cursor: pointer;
    background-color: rgb(36, 128, 124);
    border: none;
    color: white;
    border-radius: 8px;
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    display: inline-block;
}

button:hover,
.custom-file-btn:hover {
    background-color: rgb(27, 154, 119);
}

button:active,
.custom-file-btn:active {
    background-color: rgb(143, 192, 165);
    transform: translateY(4px);
}

button:focus,
.custom-file-btn:focus {
    outline: none;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

input[type="number"] {
    width: 110px;
    padding: 6px;
}

#welcomeDialog {
    border: none;
    border-radius: 8px;
    padding: 30px 20px 20px 20px;
    width: 400px;
    max-width: 90vw;
    background: white;
    font-family: 'Fira Sans', sans-serif;
    text-align: center;
}

/* Darkened overlay */
#welcomeDialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}


#tutorialOverlay {
    position: absolute;
    background: white;
    border: 2px solid rgba(36, 128, 124);
    border-radius: 8px;
    padding: 20px 20px 30px 30px;
    width: 90vw;
    /* 90% of viewport width */
    max-width: 300px;
    /* but never too large */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10000;
}

#tutorialBackdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    /* grey overlay */
    z-index: 9998;
    display: none;
    /* only show during tutorial */
}

.tutorial-highlight {
    position: relative;
    z-index: 9999;
    /* above overlay */
    box-shadow: 0 0 0 4px rgb(14, 78, 60);
    /* highlight border */
    border-radius: 4px;
}

.tutorial-progress {
    position: absolute;
    bottom: 12px;
    right: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6b7280;
}

.tutorial-arrow {
    position: absolute;
    top: 50%;
    border: none;
    background: rgba(36, 128, 124);
    color: white;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    /* ensure clicks register */
}

.tutorial-arrow:hover {
    background: rgba(27, 154, 119);
}

.tutorial-arrow.left {
    left: -20px;
    /* outside overlay */
}

.tutorial-arrow.right {
    right: -20px;
    /* outside overlay */
}

.close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
}

.close-button:hover {
    color: rgba(27, 154, 119);
    ;
}

.site-footer {
  margin-top: 40px;
  padding: 15px 10px 25px 10px;
  font-size: 0.75rem;      /* smaller text */
  color: #888;             /* greyish text */
  text-align: center;
}

.site-footer hr {
  border: none;
  border-top: 1px solid #e5e5e5;  /* light separator */
  margin-bottom: 12px;
}

.footer-content a {
  color: #777;             /* grey link color */
  text-decoration: none;
}

.footer-content a:hover {
  text-decoration: underline;
}

.footer-small {
  margin-top: 6px;
  font-size: 0.7rem;
  color: #aaa;             /* even lighter */
}

/* ===== Log ===== */

#log {
    white-space: pre-wrap;
    background: #f7f7f7;
    padding: 12px;
    border-radius: 8px;
    min-height: 120px;
    max-height: 500px;
    overflow: auto;
}