:root {
    --bg:            #171B22;
    --panel:         #20252E;
    --panel-border:  #2E3542;
    --dial-face:     #EDE7D8;
    --dial-shadow:   #C9C0AB;
    --brass:         #B08D57;
    --brass-light:   #D2B37C;
    --ink:           #2A2620;
    --ink-soft:      #6B675C;
    --amber:         #E8A33D;
    --text:          #E7E5DF;
    --text-muted:    #8A90A0;
    --ok:            #5FAE80;
    --warn:          #D9A441;

    --font-display: 'Space Mono', 'Courier New', monospace;
    --font-body:    'Work Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 32px 20px 56px;
    background:
        radial-gradient(circle at 20% -10%, #232A36 0%, transparent 45%),
        var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

.site-header {
    max-width: 1100px;
    margin: 0 auto 32px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.site-eyebrow {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brass-light);
}

.site-title {
    margin: 0;
    font-size: clamp(42px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.01em;
}

.panel-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: start;
    gap: 20px;
}

#linechart_material {
  width: 100%;
    max-width: 1100px;
    height: 500px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

#digital-clock {
    font-family: monospace;
    font-size: 28px;
    font-weight: bold;
    color: white;
    background: transparent;
    /*text-align: center;*/
}
button { 
	background-color: gray;
	color: white;
	border-radius: 3px;
	}
a { color: white; text-decoration: none;}

.panel {
    background: linear-gradient(180deg, var(--panel) 0%, #1B2029 100%);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 10px 24px -18px rgba(0,0,0,0.7);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.panel-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 8px 1px var(--ok);
    transition: background 300ms ease, box-shadow 300ms ease;
}

.panel.is-stale .panel-status {
    background: var(--warn);
    box-shadow: 0 0 8px 1px var(--warn);
}

/* ---------- Gauge ---------- */

.gauge-face {
    background: var(--dial-face);
    border-radius: 10px;
    padding: 10px 6px 0;
    max-width: 320px;
    margin: 0 auto;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.25), inset 0 -1px 0 rgba(255,255,255,0.4);
}

.gauge-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.gauge-track {
    fill: none;
    stroke: var(--dial-shadow);
    stroke-width: 14;
    stroke-linecap: round;
    opacity: 0.5;
}

.gauge-zone {
    fill: none;
    stroke-width: 10;
    stroke-linecap: butt;
    opacity: 0.9;
}

.gauge-tick {
    stroke: var(--ink-soft);
    stroke-width: 1.5;
}

.gauge-tick-label {
    font-family: var(--font-display);
    font-size: 9px;
    fill: var(--ink);
}

.gauge-needle line {
    stroke: #8C2E1F;
    stroke-width: 3;
    stroke-linecap: round;
    transition: transform 900ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gauge-needle {
    transition: transform 900ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gauge-needle-hub {
    fill: var(--brass);
    stroke: #7A5F35;
    stroke-width: 1;
}

@media (prefers-reduced-motion: reduce) {
    .gauge-needle { transition: none; }
}

.digital-readout {
    align-self: center;
    background: #14100A;
    border: 1px solid #33291A;
    border-radius: 6px;
    padding: 8px 18px 6px;
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.digital-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--amber);
    text-shadow: 0 0 10px rgba(232, 163, 61, 0.45);
}

.digital-unit {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--amber);
    opacity: 0.75;
    margin-left: 4px;
}

/* Andra avläsningen i samma fönster, t.ex. luftfuktighet under temperaturen */
.digital-secondary {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #33291A;
    width: 100%;
}

.digital-secondary-value {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: #8FBFA6;
}

.digital-secondary-unit {
    font-family: var(--font-display);
    font-size: 11px;
    color: #8FBFA6;
    opacity: 0.8;
}

.digital-secondary-label {
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-left: 4px;
}

/* ---------- Stat (text-only, t.ex. luftfuktighet) ---------- */

.panel--stat {
    gap: 18px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 46px;
    font-weight: 700;
    color: var(--brass-light);
    line-height: 1;
}

.stat-unit {
    font-size: 20px;
    margin-left: 4px;
    color: var(--text-muted);
    font-family: var(--font-body);
}

/* ---------- Footer ---------- */

.panel-footer {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.site-footer {
    max-width: 1100px;
    margin: 32px auto 0;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}
