:root {
  --bg: #0f1419;
  --bg-card: #1a222d;
  --bg-input: #242f3d;
  --border: #2d3a4a;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-dim: #388bfd66;
  --success: #3fb950;
  --font: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

header {
  padding: 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Tool grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.tool-card:hover {
  border-color: var(--accent-dim);
  background: #1e2a38;
}

.tool-card.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.tool-card .icon {
  font-size: 1.5rem;
}

.tool-card .name {
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

/* Calculator panel */
.calculator-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  min-height: 280px;
  position: relative;
}

.panel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 240px;
  color: var(--text-muted);
}

.panel-placeholder .placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.tool-content {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tool-content h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1rem;
}

.calc-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.input-group {
  flex: 1;
}

.input-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

input[type="number"],
select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

.input-row .arrow {
  font-size: 1.25rem;
  color: var(--accent);
}

.btn-calc {
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.2s, transform 0.1s;
}

.btn-calc:hover {
  background: #4a9eff;
}

.btn-calc:active {
  transform: scale(0.98);
}

.result-box {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-height: 2.5rem;
}

.result-box:empty {
  display: none;
}

.result-box.has-result {
  border-left: 3px solid var(--success);
}

/* Shape selector (Volume) */
.shape-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.shape-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.shape-btn:hover {
  border-color: var(--accent-dim);
}

.shape-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.shape-inputs {
  margin-bottom: 1rem;
}
