.cm-wrap { max-width: 1200px; margin: 0 auto; background:#fff; border:1px solid #eee; border-radius:14px; overflow:hidden; }
.cm-topbar { display:flex; justify-content:space-between; align-items:center; padding:14px 16px; border-bottom:1px solid #eee; }
.cm-title { font-weight:700; font-size:16px; }
.cm-right { display:flex; gap:12px; align-items:center; }
.cm-timer { font-size:14px; color:#333; }
.cm-btn { padding:8px 12px; border-radius:10px; border:0; background:#0b74de; color:#fff; cursor:pointer; }
.cm-btn-danger { padding:8px 12px; border-radius:10px; border:0; background:#d63638; color:#fff; cursor:pointer; }
.cm-btn-outline { padding:8px 12px; border-radius:10px; border:1px solid #ddd; background:#333; cursor:pointer; }

.cm-sections { display:flex; gap:8px; padding:10px 12px; border-bottom:1px solid #eee; background:#fafafa; }
.cm-tab { padding:8px 12px; border-radius:10px; border:1px solid #ddd; background:#333; cursor:pointer; font-size:13px; }
.cm-tab.active { background:#0b74de; color:#fff; border-color:#0b74de; }

.cm-main { display:flex; gap:0; }
.cm-qarea { flex: 1; padding:16px; }
.cm-palette { width:260px; border-left:1px solid #eee; padding:16px; background:#fafafa; }
.cm-palette-title { font-weight:700; margin-bottom:10px; }
.cm-palette-grid { display:grid; grid-template-columns: repeat(6, 1fr); gap:8px; }

.cm-qbtn { height:34px; border-radius:10px; border:1px solid #ddd; background:#333; cursor:pointer; display: flex;
    align-items: center;
    justify-content: center;}
.cm-qbtn.answered { background:#1a9b4a; border-color:#1a9b4a; color:#fff; }
.cm-qbtn.active { outline:2px solid #0b74de; }

.cm-qhead { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.cm-qno { font-weight:700; }
.cm-qtext { padding:12px; border:1px solid #eee; border-radius:12px; margin-bottom:12px; min-height:80px; background:#fff; }

.cm-options { display:flex; flex-direction:column; gap:10px; }
.cm-opt { display:flex; align-items:flex-start; gap:10px; border:1px solid #eee; border-radius:12px; padding:10px; cursor:pointer; background:#fff; }
.cm-opt input { margin-top:4px; }
.cm-opt-badge { width:26px; height:26px; border-radius:8px; background:#0b74de; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12px; }
.cm-opt-text { flex:1; font-size:14px; line-height:1.35; }

.cm-tita input { width:100%; padding:12px; border-radius:12px; border:1px solid #ddd; font-size:16px; }

.cm-nav { display:flex; gap:10px; margin-top:16px; }

/* Calculator */
.cm-cal {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 300px;
  background:#fff;
  border:1px solid #ddd;
  border-radius:14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  display:none;
  z-index: 99999;
}
.cm-cal.open { display:block; }
.cm-cal.minimized .cm-cal-body { display:none; }

.cm-cal-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 12px;
  border-bottom:1px solid #eee;
  cursor: move;
  user-select:none;
}
.cm-cal-title { font-weight:700; }
.cm-cal-actions { display:flex; gap:8px; }
.cm-cal-ic { width:28px; height:28px; border-radius:10px; border:1px solid #ddd; background:#333; cursor:pointer; display: flex;
    align-items: center;
    justify-content: center; }

.cm-cal-body { padding:10px; }
.cm-cal-screen {
  width:100%;
  height:44px;
  border-radius:12px;
  border:1px solid #ddd;
  padding:8px 10px;
  font-size:18px;
  text-align:right;
  margin-bottom:10px;
}
.cm-cal-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap:8px; }
.cm-cal-grid button {
  padding:10px 0;
  border-radius:12px;
  border:1px solid #ddd;
  background:#fff;
  cursor:pointer;
  font-weight:600;
}
.cm-cal-eq { grid-row: span 2; background:#0b74de !important; color:#fff; border-color:#0b74de !important; }
.cm-cal-zero { grid-column: span 2; }

/* FORCE calculator button text to be visible (theme-safe) */
#cm-calculator .cm-cal-grid button{
  color:#111 !important;
  font-size:16px !important;
  line-height:1 !important;
  font-weight:700 !important;
  opacity:1 !important;
  text-indent:0 !important;
  letter-spacing:0 !important;
  text-transform:none !important;

  -webkit-appearance: none !important;
  appearance: none !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  user-select:none !important;
  cursor:pointer !important;
}

#cm-calculator .cm-cal-grid button:focus{
  outline:none !important;
  box-shadow:none !important;
}

#cm-calculator .cm-cal-grid button.cm-cal-eq{
  color:#fff !important;
}
