:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --panel-bg: #ffffff;
  --primary-color: #5567d4;
  --toggle-inactive: #f0f0f0;
  --toggle-text-inactive: #b5b5b5;
  --unit-inactive: #b5b5b5;
  --dark-btn: #1a1a1a;
  --gauge-ticks: #1a1a1a;
}

[data-theme="dark"] {
  --bg-color: #111827;
  --text-color: #f9fafb;
  --panel-bg: #1f2937;
  --primary-color: #60a5fa;
  --toggle-inactive: #374151;
  --toggle-text-inactive: #9ca3af;
  --unit-inactive: #6b7280;
  --dark-btn: #f9fafb;
  --gauge-ticks: #f9fafb;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { 
  background-color: var(--bg-color); 
  color: var(--text-color); 
  transition: background-color 0.3s, color 0.3s; 
  line-height: 1.6; 
}

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

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 5%; background-color: var(--panel-bg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100;
}

.logo { font-size: 1.2rem; font-weight: 800; color: var(--primary-color); }
nav ul { display: flex; list-style: none; gap: 1.5rem; }
nav a { font-weight: 500; font-size: 0.9rem; transition: color 0.2s; }
nav a:hover { color: var(--primary-color); }

.header-controls { display: flex; align-items: center; gap: 1rem; }
button.icon-btn, select.lang-select {
  background: var(--toggle-inactive); border: none; color: var(--text-color);
  padding: 0.5rem; border-radius: 5px; cursor: pointer; outline: none; transition: 0.2s;
}

.container { max-width: 800px; margin: 0 auto; padding: 2rem 1rem; }

.tool-section { text-align: center; margin-bottom: 3rem; padding: 2rem 0; }

/* Display Area */
.display-area {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 380px; margin-bottom: 2rem;
}

/* Digital View */
.digital-view { display: flex; flex-direction: column; align-items: center; }
.digital-font {
  font-family: 'Share Tech Mono', monospace; font-size: 8rem; line-height: 1;
  color: var(--text-color); letter-spacing: -2px;
}
.unit-label { font-size: 1.5rem; font-weight: 300; color: var(--text-color); margin-top: 10px; }

/* Analog View */
.gauge-container {
  position: relative; width: 320px; height: 320px;
  border-radius: 50%; border: 4px solid var(--text-color); background: var(--panel-bg);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.gauge-ticks { position: absolute; width: 100%; height: 100%; top: 0; left: 0; }
.gauge-numbers { position: absolute; width: 100%; height: 100%; top: 0; left: 0; font-size: 14px; font-weight: 500; color: var(--text-color); }
.gauge-needle-container {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); transform: rotate(-135deg);
}
.gauge-needle-line {
  position: absolute; bottom: 50%; left: 50%; width: 6px; height: 130px;
  background: var(--text-color); transform: translateX(-50%); border-radius: 6px 6px 0 0;
}
.gauge-center-dot {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 35px; height: 35px; background: var(--text-color); border-radius: 50%;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3); z-index: 10;
}
.gauge-digital-inset {
  position: absolute; bottom: 45px; width: 100%; text-align: center;
}
.digital-font-small { font-family: 'Share Tech Mono', monospace; font-size: 2.5rem; line-height: 1; color: var(--text-color); }
.unit-label-small { font-size: 1rem; font-weight: 300; color: var(--text-color); }

/* Toggles */
.mode-toggles { display: flex; gap: 15px; justify-content: center; margin-bottom: 30px; }
.toggle-btn {
  padding: 15px 40px; border-radius: 30px; border: none; font-weight: 600; font-size: 1rem;
  letter-spacing: 0.5px; cursor: pointer; background: var(--toggle-inactive); color: var(--toggle-text-inactive); transition: 0.2s;
}
.toggle-btn.active { background: var(--primary-color); color: white; box-shadow: 0 4px 15px rgba(85,103,212,0.3); }

.unit-toggles { display: flex; gap: 20px; justify-content: center; margin-bottom: 40px; font-size: 1.2rem; font-weight: 300; }
.unit-toggles span { color: var(--unit-inactive); cursor: pointer; transition: 0.2s; }
.unit-toggles span.active { color: var(--primary-color); font-weight: 400; }

.action-section { display: flex; justify-content: center; }
.start-btn {
  background: var(--dark-btn); color: var(--panel-bg); padding: 18px 60px;
  border-radius: 15px; border: 4px solid #e0e0e0; font-size: 1.2rem; font-weight: 600;
  cursor: pointer; box-shadow: 0 10px 20px rgba(0,0,0,0.1); transition: 0.2s; letter-spacing: 1px;
}
[data-theme="dark"] .start-btn { border-color: #374151; color: var(--bg-color); }
.start-btn.running {
  background: var(--primary-color); border-color: var(--primary-color); color: white;
}

.status-bar { margin-top: 1.5rem; font-size: 0.9rem; display: flex; justify-content: space-between; color: #6b7280; }
.status-error { color: #ef4444; font-weight: 600; }

.main-heading {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.content-section { margin-bottom: 2rem; padding: 2rem; background: var(--panel-bg); border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.content-section p, .content-section ul { margin-bottom: 1rem; font-size: 1.05rem; line-height: 1.8; color: var(--text-color); }
.content-section ul { padding-left: 1.5rem; }
.content-section li { margin-bottom: 0.5rem; }
.content-section h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--toggle-inactive);
    padding-bottom: 0.5rem;
}
.content-section h3 { font-size: 1.3rem; margin-top: 1.5rem; margin-bottom: 0.8rem; color: var(--primary-color); }

.faq-item { margin-bottom: 1.5rem; background: var(--toggle-inactive); padding: 1.5rem; border-radius: 10px; }
.faq-item h3 { margin-top: 0; color: var(--text-color); margin-bottom: 0.5rem; font-size: 1.1rem; }
.faq-item p { margin: 0; font-size: 1rem; color: var(--toggle-text-inactive); }

footer {
  background: var(--panel-bg); text-align: center; padding: 2rem 1rem; margin-top: 3rem;
  border-top: 1px solid var(--toggle-inactive);
}
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.disclaimer { font-size: 0.8rem; color: #6b7280; margin-top: 1rem; }

@media (max-width: 600px) {
  header { flex-direction: column; gap: 1rem; }
  .digital-font { font-size: 6rem; }
  .toggle-btn { padding: 12px 25px; }
  .unit-toggles { font-size: 1rem; gap: 15px; }
}
