/* ============================================
   UNIVERSAL CALCULATOR FRAMEWORK
   ============================================ */
.calc-ui {
  --bg:#111111;
  --panel:#1b1b1b;
  --text:#e6e6e6;
  --muted:#9aa0a6;
  --accent:#4da3ff;
  --border:#2a2a2a;
  --input:#101010;

  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;

  width:100%;
  margin:0 auto;
  padding:0;
  background:var(--bg);
  box-sizing:border-box;
}

.calc-ui.light-theme {
  --bg:#ffffff;
  --panel:#ffffff;
  --text:#000000;
  --muted:#444444;
  --accent:#004c9e;
  --border:#cccccc;
  --input:#f5f5f5;
}

/* ============================================
   WRAPPER
   ============================================ */
.calc-ui .wrap {
  width:100%;
  max-width:100%;
  margin:24px auto;
  padding:16px;
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  justify-content:center;
  align-items:flex-start;
  box-sizing:border-box;
}

/* ============================================
   PANEL
   ============================================ */
.calc-ui .panel {
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:10px;
  padding:16px;
  flex:1 1 48%;
  min-width:380px;
  box-shadow:0 0 18px rgba(0,0,0,.45);
  box-sizing:border-box;
}

.calc-ui h2 {
  margin:0 0 12px;
  color:var(--accent);
  font-size:18px;
}

.calc-ui p,
.calc-ui .small {
  color:var(--muted);
}

/* ============================================
   GRID HELPERS
   ============================================ */
.calc-ui .grid {
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

/* optional for 2-col input grids when wide */
@media (min-width: 1100px) {
  .calc-ui .grid.grid-2 {
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}

/* ============================================
   INPUTS
   ============================================ */
.calc-ui input[type="text"],
.calc-ui input[type="number"],
.calc-ui select {
  width:100%;
  padding:8px 10px;
  border-radius:6px;
  border:1px solid var(--border);
  background:var(--input);
  color:var(--text);
  box-sizing:border-box;
}

.calc-ui input:focus,
.calc-ui select:focus {
  outline:0;
  border-color:var(--accent);
  box-shadow:0 0 0 3px #4da3ff20;
}

.calc-ui input[type=range] {
  width:100%;
  accent-color:var(--accent);
}

/* ============================================
   BUTTONS
   ============================================ */
.calc-ui button {
  width:100%;
  padding:10px;
  border-radius:8px;
  border:none;
  background:var(--accent);
  color:#021223;
  font-weight:700;
  cursor:pointer;
}

.calc-ui button.secondary {
  background:transparent;
  color:var(--accent);
  border:1px solid var(--border);
}

/* ============================================
   TABLES (lathe)
   ============================================ */
.calc-ui table {
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

.calc-ui th,
.calc-ui td {
  padding:4px 6px;
  border-bottom:1px solid var(--border);
}

/* ============================================
   CANVAS / VISUALS
   ============================================ */
.calc-ui .canvas-wrap {
  padding:8px;
  border-radius:8px;
  background:#050505;
}

.calc-ui canvas {
  width:100%;
  max-width:100%;
  height:auto;
  border-radius:6px;
  border:1px solid var(--border);
  display:block;
  background:#000;
}

.calc-ui.light-theme canvas {
  background:#ffffff !important;
  border-color:#bbbbbb !important;
}

/* ============================================
   OUTPUT TEXT
   ============================================ */
.calc-ui .out {
  margin-top:8px;
  font-family:ui-monospace,Menlo,Consolas,monospace;
  font-size:14px;
  line-height:1.5;
}

/* ============================================
   BADGE
   ============================================ */
.calc-ui .badge {
  display:inline-block;
  font-size:11px;
  padding:2px 6px;
  border-radius:999px;
  background:#141414;
  border:1px solid var(--border);
  color:var(--muted);
  margin-bottom:6px;
}

/* ============================================
   DESKTOP OVERRIDE: FULL-WIDTH + WIDER PANELS
   ============================================ */
@media (min-width: 900px) {

  /* Break out of the narrow WP content container */
  .calc-ui {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    max-width: 100vw;
  }

  .calc-ui .wrap {
    width: 100%;
    max-width: 100%;
    margin: 24px auto;
    padding: 16px 32px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 24px;
    justify-content: center;
    align-items: flex-start;
    box-sizing: border-box;
  }

  /* Two big columns side by side */
  .calc-ui .panel {
    flex: 1 1 0;
    max-width: 50%;
    min-width: 0; /* let them grow as wide as needed */
  }
}


/* ============================================
   MOBILE / TABLET: FULL-WIDTH, NO GAP
   ============================================ */
@media (max-width: 899px) {

  /* Break calculator out of WP padding and make it full viewport width */
  .calc-ui {
    position:relative;
    left:50%;
    transform:translateX(-50%);
    width:100vw;
    max-width:100vw;
    margin:0;
    padding:0;
  }

  .calc-ui .wrap {
    width:100%;
    max-width:100%;
    margin:0;
    padding:12px 12px 24px;
    flex-direction:column;
    flex-wrap:nowrap;
    gap:12px;
    align-items:stretch;
    box-sizing:border-box;
  }

  .calc-ui .panel {
    width:100%;
    max-width:100%;
    min-width:0;
    border-radius:8px;
    box-shadow:0 0 12px rgba(0,0,0,.35);
  }
}

/* ============================================
   HELP REDUCE THEME PADDING AROUND IT ON MOBILE
   ============================================ */
@media (max-width: 899px) {
  .entry-content,
  .entry-content > .wp-block-group,
  .entry-content > .wp-block,
  .wp-block-group__inner-container,
  .wp-block-columns,
  .wp-block-column {
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
    max-width:100% !important;
    width:100% !important;
  }
}
