html {
    background-color: #bbbbbb;
    padding: 0px;
}
/* Use border-box everywhere for simpler sizing on mobile */
* { box-sizing: border-box; }
body {
    width: 80%;
    min-height: calc(100vh - 4em);
    margin: 0 auto;
    padding: 2em;
    background-color: #dddddd;
    border-color: #eeeeee;
    border-left-style: solid;
    border-right-style: solid;
    border-width: 20px;
}
p {
    color: #444444;
    font-family: 'Roboto', sans-serif;
    font-size: 16pt;
    line-height: 1;
    margin: 4pt;
}
a{
    color: #2222DD;
}
a:hover{
    color: #22DDDD;
}
p.value-description {
    text-indent: -16pt;
    margin-left: 20pt;
}
p.question {
    margin: 16pt auto;
    color: #333333;
    font-family: 'Montserrat', sans-serif;
    font-weight: normal;
    width: 70%;
    min-width: 0;
    min-height: 144pt;
    background-color: #eeeeee;
    padding: 16pt;
    border-radius: 16pt;
    font-size: 36pt;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;

}
h1 {
    color: #222222;
    font-family: 'Montserrat', sans-serif;
    font-size: 72pt;
    text-align: center;
    line-height: 72pt;
    margin-top: 0pt;
    margin-bottom: 0pt;
}
#svgHeader {
    display: none;
}
h2 {
    color: #333333;
    font-family: 'Montserrat', sans-serif;
    font-size: 36pt;
    line-height: 36pt;
    margin-top: 12pt;
    margin-bottom: 0pt;
}
li {
    font-size: 16pt;
    text-indent: 16pt;
}
a {
    font-family: inherit;
}

.selection {
    background-color: #4caf50;
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 8pt;
    color: white;
    padding: 8pt;
    width: 50%;
    min-width: 0;
    text-align: center;
    text-decoration: none;
    display: block;
    font-size: 24pt;
    margin: -2px auto;
    cursor: pointer;
}

.num_input {
    background-color: #2196f3;
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 8pt;
    color: white;
    padding: 8pt;
    width: 50%;
    min-width: 0;
    text-align: center;
    text-decoration: none;
    display: block;
    font-size: 24pt;
    margin: -2px auto;
    cursor: pointer;
}

.text_input {
    background-color: #2196f3;
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 8pt;
    color: white;
    padding: 8pt;
    width: 50%;
    min-width: 0;
    text-align: center;
    text-decoration: none;
    display: block;
    font-size: 24pt;
    margin: -2px auto;
    cursor: pointer;
}

img.center {
    display: block;
    margin: 1em auto;
    width: 50%;
    min-width: 0;
}
.button {
    background-color: #2196f3;
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 8pt;
    color: white;
    padding: 8pt;
    width: 50%;
    min-width: 0;
    text-align: center;
    text-decoration: none;
    display: block;
    font-size: 24pt;
    margin: -2px auto;
    cursor: pointer;
}
.green_button {
    background-color: #4caf50;
}
.small_button, .small_button_off {
    background-color: #333;
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 8pt;
    color: white;
    padding: 8pt;
    width: 10%;
    min-width: 0;
    text-align: center;
    text-decoration: none;
    display: block;
    font-size: 18pt;
    margin: -2px auto;
    cursor: pointer;
}
.small_button_off {
    background-color: #ddd;
    color: #888;
    border: 2px solid #888;
    cursor: not-allowed;
    margin: -4px auto;
}
.button:disabled {
    background-color: #ddd;
    font-family: 'Montserrat', sans-serif;
    border: 2px solid #888;
    border-radius: 8pt;
    color: #888;
    padding: 8pt;
    width: 50%;
    min-width: 0;
    text-align: center;
    text-decoration: none;
    display: block;
    font-size: 24pt;
    margin: -2px auto;
    cursor: not-allowed;
}
div.text-wrapper {
    font-family: 'Montserrat', sans-serif;
    font-size: 36pt;
    line-height: 36pt;
    color: #222222;
    display: inline-block;
}
span.weight-300 {
    font-weight: 300;
}
#banner {
    border-color: #444444;
    border-style: solid;
    border-width: 2px;
    border-radius: 8pt;
    display: block;
    margin: 8pt;
    margin-left: auto;
    margin-right: auto;
    max-width: 50%;
    min-width: 500pt;
}

@media screen and (orientation:portrait) {
    body {
        width: auto !important;
        border-width: 0px !important;  
    }
    
    .title {
        display: none;
    }
    
    #svgHeader {
        display: block !important;
    }

    .svgHeader {
        color: #222222;
        font-family: 'Montserrat', sans-serif;
        text-align: center;
        margin-top: 0pt;
        margin-bottom: 0pt;
        font-weight: bold;
        text-anchor: middle;
    }
    
    #banner {
        min-width: 0px;
        max-width: 100%;
        border-width: 1px;
    }
    
    .button, .button:disabled, .text_input, .num_input, .selection {
        min-width: 0px;
        max-width: 100%;
        width: 100%;
        font-size: 1.5em;
    }
    
    h2 {
        font-size: 1.5em;
        line-height: initial
    }

    p.question {
        min-height: 180px !important;
        font-size: 1.1em;
    }
}

/* Additional small-screen adjustments */
@media screen and (max-width: 520px) {
    h1 { font-size: 28px; }
    h2 { font-size: 18px; }
    p.question { font-size: 18px; padding: 12px; }
    .button, .selection, .text_input, .num_input { font-size: 16px; padding: 10px; }
    .small_button, .small_button_off { width: 40%; margin: 8px auto; }
}

/* Extra tweaks for small devices to avoid clipping and overflow */
@media screen and (max-width: 420px) {
    body { width: 100%; padding: 10px; border-width: 0; }
    .title { display: none; }
    #svgHeader { display: block; }
    .svgHeader { font-size: 18px; fill: #222222; }
    p.question { font-size: 16px; padding: 14px; border-radius: 12px; min-height: 150px; }
    .button, .selection { width: 100%; font-size: 16px; padding: 12px; margin: 8px 0; }
    .small_button, .small_button_off { display: inline-block; width: 48%; min-width: 0; margin: 6px 1%; }
    #question-number { font-size: 16px; }
    .progress-bar { height: 8px; margin-bottom: 8px; }
}

/* Additional compass tooltip and progress styles */
.tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    color: #222;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
    pointer-events: none;
    z-index: 10;
    max-width: 220px;
}

.progress-panel {
    margin-top: 12px;
    font-family: 'Roboto', sans-serif;
}

.progress-panel strong {
    display: block;
    margin-bottom: 4px;
}

.progress-bar-wrapper {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196f3 0%, #4caf50 100%);
    width: 0%;
    transition: width 0.2s ease;
}

.progress-value {
    margin-top: 4px;
    font-size: 11px;
    color: #333;
}
