.sgx-cc {
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Arial,sans-serif;
}

.sgx-cc__card {
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  padding:20px;
  box-shadow:0 8px 24px rgba(0,0,0,.06);
}

.sgx-cc__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.sgx-cc__title{
  margin:0;
  font-size:20px;
  line-height:1.2;
}

.sgx-cc__subtitle{
  margin:6px 0 0;
  color:#666;
  font-size:13px;
}

.sgx-cc__pill{
  padding:6px 10px;
  border-radius:999px;
  background:#f3f4f6;
  font-size:12px;
  color:#333;
  border:1px solid rgba(0,0,0,.06);
}

.sgx-cc__grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  margin-top:14px;
}

.sgx-cc__grid--settings{
  grid-template-columns: 1fr 1fr;
}

.sgx-cc__field--full{
  grid-column: 1 / -1;
}

.sgx-cc__field label{
  display:block;
  font-size:13px;
  color:#222;
  margin-bottom:6px;
}

.sgx-cc__muted{
  color:#777;
  font-weight:400;
}

.sgx-cc__input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.14);
  background:#fff;
  font-size:14px;
  outline:none;
}

.sgx-cc__input:focus{
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.sgx-cc__textarea{
  resize:vertical;
  font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}

.sgx-cc__hint{
  margin-top:6px;
  font-size:12px;
  color:#666;
}

.sgx-cc__hint code{
  background:#f3f4f6;
  padding:2px 6px;
  border-radius:8px;
}

.sgx-cc__divider{
  height:1px;
  background:rgba(0,0,0,.08);
  margin:16px 0;
}

.sgx-cc__btn{
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  padding:9px 12px;
  border-radius:12px;
  font-size:13px;
  cursor:pointer;
}

.sgx-cc__btn--primary{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}

.sgx-cc__btn--ghost{
  background:#fff;
}

.sgx-cc__btn--big{
  width:100%;
  padding:12px 14px;
  font-size:15px;
  border-radius:14px;
}

.sgx-cc__actions{
  display:grid;
  grid-template-columns: 1fr 120px;
  gap:10px;
}

.sgx-cc__notice{
  padding:10px 12px;
  border-radius:12px;
  font-size:13px;
  margin-top:10px;
}

.sgx-cc__notice--info{
  background:#eff6ff;
  border:1px solid rgba(37,99,235,.18);
  color:#1e3a8a;
}

.sgx-cc__notice--ok{
  background:#ecfdf5;
  border:1px solid rgba(16,185,129,.18);
  color:#065f46;
}

.sgx-cc__notice--warn{
  background:#fff7ed;
  border:1px solid rgba(234,88,12,.18);
  color:#7c2d12;
}

.sgx-cc__result{
  margin-top:14px;
}

.sgx-cc__resultCard{
  background:#f8fafc;
  border:1px solid rgba(0,0,0,.07);
  border-radius:16px;
  padding:14px;
}

.sgx-cc__row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:6px 0;
  font-size:13px;
}

.sgx-cc__total{
  font-size:16px;
  padding-top:10px;
  margin-top:10px;
  border-top:1px solid rgba(0,0,0,.08);
}

.sgx-cc__small{
  font-size:12px;
  color:#666;
  margin-top:10px;
}

@media (max-width: 560px){
  .sgx-cc__grid,
  .sgx-cc__grid--settings{
    grid-template-columns:1fr;
  }

  .sgx-cc__actions{
    grid-template-columns: 1fr;
  }
}

/* ===== MODAL ===== */
.sgx-cc__modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;

  /* IMPORTANT FIX */
  isolation: isolate;
}

.sgx-cc__modal.is-open {
  display: block;
}

.sgx-cc__modalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.sgx-cc__modalCard {
  position: relative;
  max-width: 520px;
  margin: 10vh auto;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
}

.sgx-cc__modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.sgx-cc__modal {
  z-index: 2147483647 !important;
}
.sgx-cc__modal.is-open {
  display: block !important;
}
body .sgx-cc__modal {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}
.sgx-cc__tabs {
  display: flex;
  gap: 6px;
  margin: 16px 0;
}

.sgx-cc__tab {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  cursor: pointer;
}

.sgx-cc__tab.is-active {
  background: #2563eb;
  color: #fff;
}

.sgx-cc__spreadTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sgx-cc__spreadTable th,
.sgx-cc__spreadTable td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.sgx-cc__spreadTable td:first-child,
.sgx-cc__spreadTable th:first-child {
  text-align: center;
}

.sgx-cc__spreadTable tr.center {
  background: #f3f4f6;
}

.sgx-cc__spreadTable .pos {
  color: #065f46;
}

.sgx-cc__spreadTable .neg {
  color: #7c2d12;
}
/* ===============================
   FORCE BUTTON VISIBILITY
   =============================== */

.sgx-cc button {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ===============================
   PRIMARY BUTTON STYLE
   =============================== */

.sgx-cc__btn {
  appearance: none;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.sgx-cc__btn:hover {
  background: #1d4ed8;
}

.sgx-cc__btn:active {
  transform: translateY(1px);
}

/* =====================================
   FORCE BUTTON VISIBILITY (THEME FIX)
   ===================================== */

.sgx-cc button,
.sgx-cc__btn,
.sgx-cc__tab {
  color: #111827 !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-indent: 0 !important;
}

/* Primary buttons */
.sgx-cc__btn--primary {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #2563eb !important;
}

/* Tabs */
.sgx-cc__tab {
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
}

.sgx-cc__tab.is-active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

/* Icons inside buttons */
.sgx-cc button svg,
.sgx-cc button i {
  color: inherit !important;
  fill: currentColor !important;
}
.sgx-cc__table .is-base {
  background: #f3f4f6;
  font-weight: 600;
}

.sgx-cc__table .pos {
  color: #0f766e;
}

.sgx-cc__table .neg {
  color: #b91c1c;
}
/* ===== Spread table polish ===== */
.sgx-cc [data-slot="spread-result"]{
  margin-top: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  background: #fff;
}

.sgx-cc__table{
  width: 100%;
  border-collapse: collapse;
  min-width: 680px; /* keeps columns readable; container scrolls on small screens */
  font-size: 13px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.sgx-cc__table thead th{
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  text-align: right;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(0,0,0,.10);
  color: #111;
  font-weight: 600;
  white-space: nowrap;
}

.sgx-cc__table thead th:first-child,
.sgx-cc__table tbody td:first-child{
  text-align: center;
}

.sgx-cc__table tbody td{
  padding: 9px 10px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  text-align: right;
  white-space: nowrap;
}

.sgx-cc__table tbody tr:nth-child(even){
  background: rgba(0,0,0,.02);
}

.sgx-cc__table tbody tr:hover{
  background: rgba(37,99,235,.06);
}

.sgx-cc__table tbody tr.is-base{
  background: rgba(37,99,235,.10) !important;
  font-weight: 700;
}

.sgx-cc__table td.pos{
  color: #0f766e; /* green */
  font-weight: 600;
}

.sgx-cc__table td.neg{
  color: #b91c1c; /* red */
  font-weight: 600;
}

.sgx-cc__checks{
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.sgx-cc__check{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

