*,
.icon-button {
    position: relative
}

.overlay,
.tooltip {
    opacity: 0;
    visibility: hidden
}

#info-panel h3,
#info-panel li,
#info-panel ul ul {
    margin-bottom: 8px
}

:root {
    --md-sys-color-primary-light: #006496;
    --md-sys-color-on-primary-light: #ffffff;
    --md-sys-color-primary-container-light: #cce5ff;
    --md-sys-color-on-primary-container-light: #001e31;
    --md-sys-color-secondary-light: #51606f;
    --md-sys-color-on-secondary-light: #ffffff;
    --md-sys-color-secondary-container-light: #d4e4f6;
    --md-sys-color-on-secondary-container-light: #0d1d2a;
    --md-sys-color-tertiary-light: #67587a;
    --md-sys-color-on-tertiary-light: #ffffff;
    --md-sys-color-tertiary-container-light: #ecdcff;
    --md-sys-color-on-tertiary-container-light: #221534;
    --md-sys-color-error-light: #ba1a1a;
    --md-sys-color-on-error-light: #ffffff;
    --md-sys-color-error-container-light: #ffdad6;
    --md-sys-color-on-error-container-light: #410002;
    --md-sys-color-background-light: #f8faff;
    --md-sys-color-on-background-light: #1a1c1e;
    --md-sys-color-surface-light: #f8faff;
    --md-sys-color-on-surface-light: #1a1c1e;
    --md-sys-color-surface-container-low-light: #f2f4f7;
    --md-sys-color-surface-variant-light: #dee3eb;
    --md-sys-color-on-surface-variant-light: #42474e;
    --md-sys-color-outline-light: #72777f;
    --md-sys-color-outline-variant-light: #c2c7cf;
    --md-sys-color-shadow-light: #000000;
    --md-sys-color-inverse-surface-light: #2f3133;
    --md-sys-color-inverse-on-surface-light: #f0f0f3;
    --md-sys-color-inverse-primary-light: #92ccff;
    --md-ref-typeface-plain: 'Aria', sans-serif;
    --md-ref-typeface-mono: 'Aria', sans-serif;
    --bg-color: var(--md-sys-color-background-light);
    --surface-color: var(--md-sys-color-surface-light);
    --primary-color: var(--md-sys-color-primary-light);
    --primary-variant: #00507a;
    --on-primary: var(--md-sys-color-on-primary-light);
    --text-color: var(--md-sys-color-on-surface-light);
    --text-color-secondary: var(--md-sys-color-on-surface-variant-light);
    --divider-color: var(--md-sys-color-outline-variant-light);
    --border-color: var(--md-sys-color-outline-variant-light);
    --input-border-color: var(--md-sys-color-outline-light);
    --error-color: var(--md-sys-color-error-light);
    --on-error-color: var(--md-sys-color-on-error-light);
    --shadow-color: var(--md-sys-color-shadow-light);
    --progress-bar-bg: var(--md-sys-color-surface-variant-light);
    --panel-shadow: 0 8px 10px -5px rgba(0, 0, 0, 0.2), 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12);
    --font-sans: var(--md-ref-typeface-plain);
    --font-mono: var(--md-ref-typeface-mono);
    --hover-opacity: 0.08;
    --focus-opacity: 0.12;
    --pressed-opacity: 0.12;
    --disabled-opacity: 0.38;
    --disabled-container-opacity: 0.12
}

[data-theme=dark] {
    --md-sys-color-primary-dark: #92ccff;
    --md-sys-color-on-primary-dark: #003450;
    --md-sys-color-primary-container-dark: #004b71;
    --md-sys-color-on-primary-container-dark: #cce5ff;
    --md-sys-color-secondary-dark: #b8c8da;
    --md-sys-color-on-secondary-dark: #23323f;
    --md-sys-color-secondary-container-dark: #394857;
    --md-sys-color-on-secondary-container-dark: #d4e4f6;
    --md-sys-color-tertiary-dark: #d0bfe7;
    --md-sys-color-on-tertiary-dark: #382a4a;
    --md-sys-color-tertiary-container-dark: #4f4161;
    --md-sys-color-on-tertiary-container-dark: #ecdcff;
    --md-sys-color-error-dark: #ffb4ab;
    --md-sys-color-on-error-dark: #690005;
    --md-sys-color-error-container-dark: #93000a;
    --md-sys-color-on-error-container-dark: #ffdad6;
    --md-sys-color-background-dark: #1a1c1e;
    --md-sys-color-on-background-dark: #e2e2e5;
    --md-sys-color-surface-dark: #1a1c1e;
    --md-sys-color-on-surface-dark: #e2e2e5;
    --md-sys-color-surface-container-low-dark: #1f2428;
    --md-sys-color-surface-variant-dark: #42474e;
    --md-sys-color-on-surface-variant-dark: #c2c7cf;
    --md-sys-color-outline-dark: #8c9199;
    --md-sys-color-outline-variant-dark: #42474e;
    --md-sys-color-shadow-dark: #000000;
    --md-sys-color-inverse-surface-dark: #e2e2e5;
    --md-sys-color-inverse-on-surface-dark: #1a1c1e;
    --md-sys-color-inverse-primary-dark: #006496;
    --bg-color: var(--md-sys-color-background-dark);
    --surface-color: var(--md-sys-color-surface-dark);
    --primary-color: var(--md-sys-color-primary-dark);
    --primary-variant: #b3d9ff;
    --on-primary: var(--md-sys-color-on-primary-dark);
    --text-color: var(--md-sys-color-on-surface-dark);
    --text-color-secondary: var(--md-sys-color-on-surface-variant-dark);
    --divider-color: var(--md-sys-color-outline-variant-dark);
    --border-color: var(--md-sys-color-outline-variant-dark);
    --input-border-color: var(--md-sys-color-outline-dark);
    --error-color: var(--md-sys-color-error-dark);
    --on-error-color: var(--md-sys-color-on-error-dark);
    --shadow-color: var(--md-sys-color-shadow-dark);
    --progress-bar-bg: var(--md-sys-color-surface-variant-dark);
    --panel-shadow: 0 8px 10px -5px rgba(0, 0, 0, 0.4), 0 16px 24px 2px rgba(0, 0, 0, 0.28), 0 6px 30px 5px rgba(0, 0, 0, 0.24)
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s, fill .3s, opacity .3s;
    -webkit-tap-highlight-color: transparent
}

body,
html {
    height: 100%;
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-color)
}

body {
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px 8px 16px;
    height: 64px;
    border-bottom: 1px solid var(--divider-color);
    flex-shrink: 0;
    background-color: var(--surface-color);
    z-index: 10
}

.header-title {
    font-weight: 400;
    font-size: 1.375rem;
    line-height: 1.75rem;
  
    flex-grow: 1;
    margin: 0 8px;
    letter-spacing: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis
}

.icon-button {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    background-color: transparent;
    color: var(--text-color-secondary);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    overflow: hidden
}

.icon-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: currentColor;
    opacity: 0;
    border-radius: 50%;
    transform: scale(1) translate(-50%, -50%);
    transform-origin: 50% 50%
}

.icon-button:active::after {
    transform: scale(15) translate(-50%, -50%);
    opacity: var(--pressed-opacity);
    transition: transform, opacity
}

.icon-button:hover,
.language-dropdown-content a:hover {
    background-color: rgba(var(--text-color), var(--hover-opacity))
}

.icon-button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    background-color: rgba(var(--text-color), var(--focus-opacity))
}

.language-dropdown {
    position: relative;
    display: inline-block
}

.language-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 160px;
    z-index: 1000;
    background-color: var(--surface-color);
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, .2);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    max-height: 50vh;
    overflow-y: scroll
}

.language-dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: .9rem;
    transition: background-color .2s
}

.language-dropdown:hover .language-dropdown-content {
    display: block
}

.material-symbols-outlined {
    display: inline-block;
    width: 24px;
    height: 24px;
    fill: currentColor;
    vertical-align: middle;
    color: inherit;
    user-select: none
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
  
}

.current-reading-wrapper {
    text-align: center;
    margin-bottom: 16px;
    width: 100%;
    position: static
}

.current-db-display {
    font-size: clamp(4.5rem, 20vw, 8rem);
    font-weight: 200;
    line-height: 1.1;
    color: var(--text-color);
    letter-spacing: -.025em;
    margin-bottom: 4px;
    font-feature-settings: "tnum"
}

.control-button,
.current-db-unit {
    font-weight: 500;
    letter-spacing: .01em
}

.current-db-unit {
    font-size: clamp(1.1rem, 5vw, 1.75rem);
    color: var(--text-color-secondary);
    line-height: 1
}

#clippingIndicator {
    position: absolute;
    top: 8px;
    right: 10%;
    background-color: var(--error-color);
    color: var(--on-error-color);
    font-size: .65rem;
    font-weight: 500;
    padding: 3px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    z-index: 5
}

#clippingIndicator.visible {
    opacity: 1
}

.stats-and-progress {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--progress-bar-bg);
    border-radius: 4px;
    overflow: hidden;
    margin: 0
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width .2s linear, background-color .3s
}

.chart-container,
.reading-box {
    border-radius: 12px;
    box-shadow: 0 1px 2px 0 rgba(var(--shadow-color), .1), 0 1px 3px 1px rgba(var(--shadow-color), .08);
    background-color: var(--surface-color)
}

#levelDescription {
    font-size: .875rem;
    line-height: 1.25rem;
    color: var(--text-color-secondary);
    text-align: center;
    margin-top: 8px;
    height: 1.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.stats-readings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    width: 100%;
    margin: 0;
    text-align: center
}

.reading-box {
    padding: 12px 16px
}

.reading-box .label {
    display: block;
    font-size: .75rem;
    line-height: 1rem;
    font-weight: 500;
    color: var(--text-color-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .04em
}

.reading-box .value {
    display: block;
    font-size: 1.375rem;
    line-height: 1.75rem;
    font-weight: 500;
    color: var(--text-color);
    font-family: var(--font-mono);
    font-feature-settings: "tnum";
    white-space: nowrap
}

.chart-container {
    width: 100%;
    max-width: 700px;
    height: 200px;
    min-height: 160px;
    position: relative;
    margin: 20px auto 0;
    overflow: hidden
}

#dbChart {
    display: block;
    width: 100%;
    height: 100%
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity .2s;
    font-size: .8rem
}

.footer-link:hover {
    opacity: .8;
    text-decoration: underline
}

.footer-divider {
    margin: 0 6px;
    color: var(--text-color-secondary);
    font-size: .8rem
}

.footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 16px;
    height: 80px;
    border-top: 1px solid var(--divider-color);
    flex-shrink: 0;
    background-color: var(--surface-color);
    z-index: 10
}

.control-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: .875rem;
    cursor: pointer;
    border: none;
    border-radius: 20px;
    min-height: 40px;
    text-align: center;
    transition: background-color .2s, box-shadow .2s, opacity .2s, color .2s, border-color .2s;
    appearance: none;
    overflow: hidden;
    white-space: nowrap
}

#info-panel h3,
.reference-chart-container h2,
.settings-label {
    font-weight: 600;

    letter-spacing: .05em
}

.control-button .material-symbols-outlined {
    width: 18px;
    height: 18px;
    vertical-align: bottom
}

.control-button:disabled {
    opacity: var(--disabled-opacity);
    cursor: not-allowed;
    box-shadow: none;
    background-color: rgba(var(--text-color), var(--disabled-container-opacity));
    color: rgba(var(--text-color), var(--disabled-opacity))
}

.control-button.secondary:disabled {
    border-color: rgba(var(--text-color), var(--disabled-container-opacity));
    background-color: transparent;
    color: rgba(var(--text-color), var(--disabled-opacity));
    opacity: 1
}

.control-button:disabled:hover {
    background-color: rgba(var(--text-color), var(--disabled-container-opacity))
}

.control-button.start,
.control-button.stop {
    background-color: var(--primary-color);
    color: var(--on-primary);
    box-shadow: 0 1px 2px 0 rgba(var(--shadow-color), .15), 0 1px 3px 1px rgba(var(--shadow-color), .1)
}

.control-button.start:hover:not(:disabled),
.control-button.stop:hover:not(:disabled) {
    box-shadow: 0 1px 3px 0 rgba(var(--shadow-color), .15), 0 4px 8px 3px rgba(var(--shadow-color), .1);
    filter: brightness(95%)
}

[data-theme=dark] .control-button.start:hover:not(:disabled),
[data-theme=dark] .control-button.stop:hover:not(:disabled) {
    filter: brightness(110%)
}

.control-button.stop {
    background-color: var(--error-color);
    color: var(--on-error-color)
}

.control-button.secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--input-border-color)
}

.close-panel,
.settings-label,
.settings-label .info-icon {
    color: var(--text-color-secondary)
}

.control-button.secondary:hover:not(:disabled) {
    background-color: rgba(var(--primary-color), var(--hover-opacity));
    border-color: var(--primary-color)
}

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    max-width: 90%;
    height: 100vh;
    background-color: var(--surface-color);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: none;
    border-left: 1px solid var(--divider-color)
}

.side-panel.active {
    transform: translateX(0);
    box-shadow: var(--panel-shadow)
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 4px 16px 24px;
    height: 64px;
    border-bottom: 1px solid var(--divider-color);
    flex-shrink: 0
}

.panel-title {
    font-size: 1.125rem;
    line-height: 1.5rem;
    font-weight: 500
}

.panel-content {
    padding: 16px 24px;
    overflow-y: auto;
    flex-grow: 1;
    -webkit-overflow-scrolling: touch
}

.panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--divider-color);
    flex-shrink: 0;
    text-align: right
}

.settings-group {
    margin-bottom: 28px
}

#info-panel p,
.settings-label {
    margin-bottom: 12px
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .75rem
}

.settings-label .info-icon {
    width: 16px;
    height: 16px;
    cursor: help
}

.calibration-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 4px
}

.calibration-controls input[type=number] {
    width: 80px;
    flex-shrink: 0;
    text-align: right
}

.calibration-controls input[type=range] {
    flex-grow: 1;
    height: 20px
}

.settings-input,
.settings-select {
    width: 100%;
    padding: 16px;
    border-radius: 4px;
    border: 1px solid var(--input-border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.5rem;
    margin-bottom: 4px;
    transition: border-color .2s, background-color .2s, color .2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    height: 56px;
    box-sizing: border-box
}

.disclaimer,
.explanation {
    color: var(--text-color-secondary)
}

.settings-select {
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 24px;
    padding-right: 40px
}

.settings-input:focus,
.settings-select:focus {
    outline: 0;
    border: 2px solid var(--primary-color);
    padding: 15px
}

.settings-input[type=number] {
    -moz-appearance: textfield
}

.settings-input[type=number]::-webkit-inner-spin-button,
.settings-input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0
}

input[type=range] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--md-sys-color-surface-variant-light);
    border-radius: 2px;
    cursor: pointer;
    margin: 8px 0;
    display: block
}

[data-theme=dark] input[type=range] {
    background: var(--md-sys-color-surface-variant-dark)
}

input[type=range]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(var(--shadow-color), .4);
    margin-top: 0
}

input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(var(--shadow-color), .4)
}

input[type=range]:focus {
    outline: 0
}

input[type=range]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(var(--primary-color), .3)
}

input[type=range]:focus::-moz-range-thumb {
    box-shadow: 0 0 0 4px rgba(var(--primary-color), .3)
}

.explanation {
    font-size: .75rem;
    line-height: 1.4;
    padding: 4px 0 0
}

.disclaimer {
    font-size: .8rem;
    line-height: 1.5;
    padding: 12px;
    margin-top: 16px;
    border: 1px dashed var(--divider-color);
    border-radius: 8px;
    background-color: rgba(var(--text-color-secondary), .05)
}

#info-panel p strong,
.disclaimer strong {
    color: var(--text-color);
    font-weight: 500
}

.tooltip-container {
    position: relative;
    display: inline-block;
    vertical-align: middle
}

.tooltip,
.tooltip::after {
    position: absolute;
    left: 50%
}

.tooltip-trigger {
    cursor: help
}

.tooltip {
    bottom: 130%;
    transform: translateX(-50%);
    background-color: var(--md-sys-color-inverse-surface-light);
    color: var(--md-sys-color-inverse-on-surface-light);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: .75rem;
    line-height: 1.3;
    white-space: pre-wrap;
    max-width: 250px;
    z-index: 1010;
    transition: opacity .2s, visibility .2s;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2)
}

[data-theme=dark] .tooltip {
    background-color: var(--md-sys-color-inverse-surface-dark);
    color: var(--md-sys-color-inverse-on-surface-dark)
}

.tooltip-trigger:focus+.tooltip,
.tooltip-trigger:hover+.tooltip {
    opacity: .95;
    visibility: visible
}

.tooltip::after {
    content: '';
    top: 100%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--md-sys-color-inverse-surface-light) transparent transparent transparent
}

[data-theme=dark] .tooltip::after {
    border-top-color: var(--md-sys-color-inverse-surface-dark)
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .5);
    backdrop-filter: blur(3px);
    z-index: 999;
    transition: opacity .3s ease-in-out, visibility .3s ease-in-out
}

#info-panel,
.reference-chart-container {
    background-color: var(--surface-color)
}

.overlay.active {
    opacity: 1;
    visibility: visible
}

.reference-chart-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto 0;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 2px 0 rgba(var(--shadow-color), .1), 0 1px 3px 1px rgba(var(--shadow-color), .08);
    min-height: 400px
}

.reference-chart-container h2 {
    font-size: 1.25rem;
    color: var(--text-color-secondary);
    margin-bottom: 12px;
    text-align: center
}

.reference-chart-list {
    list-style: none;
    padding: 0;
    margin: 0
}

.reference-chart-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 1rem;
    line-height: 1.25rem
}

.reference-chart-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 10px;
    flex-shrink: 0;
    border: 1px solid rgba(var(--shadow-color), .1)
}

.reference-chart-level {
    font-weight: 500;
    color: var(--text-color);
    min-width: 50px;
    text-align: right;
    margin-right: 8px;
    font-family: var(--font-mono)
}

#info-panel h3,
#info-panel p,
.reference-chart-desc {
    color: var(--text-color-secondary)
}

.reference-chart-desc {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis
}

#info-panel .panel-content {
    font-size: .9rem;
    line-height: 1.6
}

#info-panel h3 {
    font-size: .875rem;
    margin-top: 20px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--divider-color)
}

#info-panel ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 16px;
    padding-left: 5px
}

#info-panel ul ul {
    margin-top: 6px
}

#info-panel code {
    background-color: rgba(var(--text-color-secondary), .1);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: .85em;
    font-family: var(--font-mono)
}

@media (max-width:600px) {
    .header {
        height: 56px;
        padding: 4px 8px 4px 16px
    }
    .header-title {
        font-size: 1rem;
        margin: 0 8px
    }
    .icon-button {
        width: 40px;
        height: 40px
    }
    .language-dropdown-content {
        right: -40px
    }
    .material-symbols-outlined {
        width: 20px;
        height: 20px
    }
    .main-content {
        padding: 16px
    }
    .current-db-display {
        font-size: clamp(3.5rem, 18vw, 6.5rem)
    }
    .current-db-unit {
        font-size: clamp(1rem, 4.5vw, 1.5rem)
    }
    .footer-divider,
    .footer-link,
    .footer-links {
        font-size: .7rem
    }
    #clippingIndicator {
        font-size: .6rem;
        padding: 2px 4px;
        top: 4px;
        right: 5%
    }
    .stats-and-progress {
        gap: 10px
    }
    .stats-readings {
        gap: 8px;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr))
    }
    .reading-box {
        padding: 8px 10px;
        border-radius: 8px
    }
    .reading-box .value {
        font-size: 1.1rem
    }
    .chart-container {
        height: 160px;
        min-height: 120px
    }
    .footer-divider {
        margin: 0 4px
    }
    .footer {
        height: 72px;
        padding: 4px 8px
    }
    .control-button {
        padding: 8px 16px;
        font-size: .8125rem;
        min-height: 36px;
        border-radius: 18px
    }
    .control-button .material-symbols-outlined {
        width: 16px;
        height: 16px
    }
    .side-panel {
        width: 280px
    }
    .panel-content {
        padding: 12px 16px
    }
    .settings-group {
        margin-bottom: 20px
    }
    .settings-input,
    .settings-select {
        padding: 14px;
        font-size: .95rem;
        height: 50px
    }
    .settings-input:focus,
    .settings-select:focus {
        padding: 13px
    }
    .explanation {
        font-size: .7rem;
        padding: 4px 0 0
    }
    .calibration-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px
    }
    .calibration-controls input[type=number] {
        width: 100%
    }
    .reference-chart-container {
        padding: 12px;
        margin-top: 16px
    }
    .reference-chart-item {
        font-size: .8rem
    }
    .reference-chart-level {
        min-width: 40px
    }
}

@media (max-height:550px) and (max-width:900px) and (orientation:landscape) {
    .app-container {
        height: 100%
    }
    .main-content {
        flex-direction: row;
        justify-content: space-evenly;
        align-items: center;
        padding: 12px;
        overflow: hidden;
        gap: 16px
    }
    .current-reading-wrapper {
        margin-bottom: 0;
        flex: 0 0 30%;
        text-align: center;
        align-self: center
    }
    .current-db-display {
        font-size: clamp(2.5rem, 10vh, 3.5rem)
    }
    .current-db-unit {
        font-size: clamp(.8rem, 3vh, 1rem)
    }
    #clippingIndicator {
        top: 0;
        right: 0;
        font-size: .55rem
    }
    .chart-container {
        height: auto;
        margin: 0;
        flex: 1 1 40%;
        min-height: 100px;
        align-self: stretch
    }
    .stats-and-progress {
        flex-direction: column;
        flex: 0 0 25%;
        padding: 0;
        justify-content: center;
        align-self: stretch;
        gap: 8px;
        margin: 0;
        max-width: 180px
    }
    .progress-bar-container {
        width: 100%;
        margin: 0;
        height: 5px;
        order: -1
    }
    #levelDescription,
    .control-button span:not(.material-symbols-outlined),
    .reference-chart-container {
        display: none
    }
    .stats-readings {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin: 0;
        width: 100%;
        max-width: none
    }
    .reading-box {
        padding: 6px 8px;
        border-radius: 6px
    }
    .reading-box .label {
        font-size: .6rem;
        margin-bottom: 1px
    }
    .reading-box .value {
        font-size: .8rem
    }
    .footer {
        height: 56px;
        padding: 4px 8px
    }
    .control-button {
        min-width: 50px;
        padding: 6px 12px;
        font-size: .75rem;
        min-height: 32px;
        border-radius: 16px;
        gap: 4px
    }
    .control-button .material-symbols-outlined {
        margin: 0;
        width: 18px;
        height: 18px
    }
}
     
   .about-tool {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem;
  background-color: var(--card-bg);
  color: var(--text-main);
  border-radius: 1rem;
  line-height: 1.6;
  font-size: 1rem;
  border-top: 2px solid var(--divider-color);
}



.about-tool h2,
.about-tool h3 {
  color: var(--heading-amber);
  margin-top: 1.5rem;
}

.about-tool h4 {
  color: var(--heading-yellow);
  margin-top: 1rem;
}

.about-tool ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.about-tool strong {
  color: var(--text-strong);
}

.feedback-container {
  background-color: #ffffff;
  padding: 40px;
  max-width: 800px;
  margin-top: 10px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: background-color 0.3s, color 0.3s;
   border: 2px solid var(--primary-color);
}

body.dark-mode .feedback-container {
  background-color: #1e1e1e;
  color: #f1f1f1;
}

.feedback-container h2 {
  margin-bottom: 20px;
  font-size: 24px;
  color: #333;
}

body.dark-mode .feedback-container h2 {
  color: #ffffff;
}

.datatext {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
  background-color: #ffffff;
  color: #000000;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body.dark-mode .datatext {
  background-color: #2a2a2a;
  color: #ffffff;
  border: 1px solid #444;
}

.thank-you {
  margin-top: 20px;
  font-size: 18px;
  font-weight: bold;
  color: #28a745;
  display: none;
}

body.dark-mode .thank-you {
  color: #66ff66;
}

 .newbutton{
    background-color:var(--primary-color); /* blue-700 */
    border: none;
    border-radius: 4px;
    color: var(--on-primary);
    font-weight: 600;
    font-size: 18px;
    padding: 10px 20px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: background-color 0.2s ease;
  }

  .newbutton:hover {
    background-color: #0056b3; /* blue-800 */
    color: var(--on-primary);
  }
  .progress-bar-wrapper {
            position: relative;
            width: 100%;
            max-width: 1000px;
            margin: 40px auto;
        }

        .progress-bar-container {
            width: 100%;
            height: 25px;
            background: #ddd;

            overflow: hidden;
            position: relative;
        }

        .progress-bar {
            height: 100%;
            width: 0%;

            transition: width 0.3s ease;
        }

        .progress-bar-ticks {
            position: relative;
            height: 30px;
            width: 100%;
            margin-top: 2px;
            margin-left: 1px
        }

        .tick {
            position: absolute;
            height: 100%;
            text-align: center;
            transform: translateX(-50%);
        }

        .tick-line {
            width: 1px;
            height: 10px;
            background: #443939;
            margin: 0 auto;
        }

        .tick-label {
            font-size: 12px;
            margin-top: 2px;
        }

        .tick-label.bold {
            font-weight: bold;
            font-size: 12px;
        }

        .tick-label.red {
            color: red;
        }

        .tick-label.orange {
            color: orange;
        }

        .tick-label.yellow {
            color: yellow;
        }

 .show-headers {
    display: none;
}

.min-header {
    display: block;
}

/* Media query for mobile/tablet view */
@media (max-width: 991px) {
    .min-header {
        display: none;
    }

    .show-headers {
        display: block;
    }
}

/* Media query for PC view */
@media (min-width: 992px) {
    .min-header {
        display: block;
    }

    .show-headers {
        display: none;
    }
} 
  .google-translate-icon {
            color: white;
            margin-right: 5px;
        }

        #google_translate_element {
            display: inline-block;
        }

        /* Hide 'Powered by Google Translate' */
        .goog-logo-link,
        .goog-te-gadget span {
            display: none !important;
        }

        .goog-te-gadget {
            color: var(--text-main) !important;
        }

        li::marker {
            display: none;
        }

          .share-btn {
            display: inline-block;
            margin: 0.3rem 0.5rem;
            padding: 0.5rem 1rem;
            color: white;
            border-radius: 5px;
            text-decoration: none;
            font-weight: bold;
            transition: background 0.3s;
        }

        hr {
            color: var(--text-main);
            margin: 20px 0;
        }

        .share-btn i {
            margin-right: 6px;
        }

        .whatsapp {
            background: #25D366;
        }

        .facebook {
            background: #1877F2;
        }

        .twitter {
            background: #1DA1F2;
        }

        .copy-link {
            background: #555;
        }

        .share-btn:hover {
            opacity: 0.85;
        }

          /* Blue Box Styling */
        .blue-box-container {
            display: flex;
            justify-content: center;
            margin-top: 30px;
            margin-bottom: 20px;
            align-items: flex-end;
            /* Aligns the blue box to the bottom */
        }

        .blue-box {
            background-color: var(--primary-color);
            /* Blue color */
            color: var(--on-primary);
            padding: 30px;
            text-align: center;
            border-radius: 10px;
            width: 100%;
            /* Ensures it spans across the container */
            max-width: 600px;
            /* Optional: limits max width */
        }

        .blue-box h2 {
            font-size: 24px;
            margin-bottom: 15px;
        }

        .blue-box p {
            font-size: 16px;
            margin-bottom: 20px;
        }

        .go-button {
            background-color: #ffffff;
            color: #007BFF;
            padding: 10px 20px;
            border-radius: 5px;
            text-decoration: none;
            font-weight: bold;
        }

        .go-button:hover {
            background-color: #0056b3;
            color: white;
        }

        /* Make sure it works responsively */
        @media (max-width: 768px) {
            .blue-box {
                padding: 20px;
            }

            .blue-box h2 {
                font-size: 20px;
            }

            .blue-box p {
                font-size: 14px;
            }

            .go-button {
                font-size: 14px;
            }
        }
        fieldset {
        all: unset;
        border: none;
        padding: 0;
        }
        h5{
            font-size: 12px;
        }

        h4{
            font-size: 16px;
        }

         .scroll-top-btn {
            position: fixed;
            bottom: 30px;
            right: 30px;
            z-index: 999;
            background-color: var(--primary-color);
            color: white;
            border: none;
            border-radius: 50%;
            padding: 12px 16px;
            font-size: 18px;
            cursor: pointer;
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
            display: none; /* hidden by default */
            transition: background 0.3s ease;
            }

            .scroll-top-btn:hover {
            background-color: #0056b3;
            }

 