/**
 * Copied from _module-template for consistency
 */

/* ===== COLOR PALETTE ===== */
:root {
  --bg: #eeeeee;
  --bg-light: #cbcdcd;
  --text: #41474e;
  --text-secondary: #44475a;
  --text-light: #646868;
  --accent: #d26878;
  --accent-light: #e08f67;
  --link: #5690af;
  --green: #56afa0;
  --blue: #5690af;
  --purple: #9271d6;
  --grey: #cbcdcd;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.dark {
  --bg: #222529;
  --bg-light: #464949;
  --text: #d6d6d6;
  --text-secondary: #e6e6e6;
  --text-light: #dbd5bc;
  --accent: #78b6ad;
  --accent-light: #87c9e5;
  --link: #e2aea2;
  --grey: #464949;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  padding: var(--spacing-lg) var(--spacing-sm);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { color: var(--text); font-weight: 700; line-height: 1.2; margin-bottom: var(--spacing-md); }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
p { margin-bottom: var(--spacing-sm); color: var(--text-light); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--spacing-md); }
.section { margin-bottom: var(--spacing-xl); }
.section-title { font-size: 1.75rem; margin-bottom: var(--spacing-sm); }
.section-subtitle { color: var(--text-light); margin-bottom: var(--spacing-lg); }

.card {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-lg);
}

.control-group { margin-bottom: var(--spacing-md); }
.control-group label { display: block; margin-bottom: var(--spacing-xs); font-weight: 600; color: var(--text); }
.control-group input[type="range"],
.control-group input[type="text"],
.control-group select { width: 100%; padding: var(--spacing-sm); border: 1px solid var(--grey); border-radius: var(--radius-md); background: var(--bg); color: var(--text); }

.chart-container { position: relative; background: #fff; border-radius: var(--radius-md); padding: var(--spacing-md); box-shadow: var(--shadow-sm); }

/* Guard against runaway canvas growth inside responsive iframes */
#iccChart {
  display: block;
  width: 100% !important;
  max-height: 440px;
}

.value-display { color: var(--accent); font-weight: 700; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--spacing-lg); }
.hidden { display: none; }

.table-simple { width: 100%; border-collapse: collapse; margin-top: var(--spacing-sm); }
.table-simple th, .table-simple td { text-align: right; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--grey); }
.table-simple th:first-child, .table-simple td:first-child { text-align: left; }

@media (max-width: 768px) {
  body { padding: var(--spacing-md) var(--spacing-xs); }
  .card { padding: var(--spacing-md); }
}
