/* Eldalil Chatwoot — calculator inside the conversation (calc1) */

.eclc-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}
.eclc-toggle:hover { background: rgba(148, 163, 184, 0.18); opacity: 1; }
.eclc-toggle.is-active { background: #f7edf0; opacity: 1; box-shadow: inset 0 0 0 1px #f9a8c9; }

.eclc-panel {
  --eclc-accent: #7a2140;
  position: fixed;
  z-index: 60;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  color: #0f172a;
  border: 1px solid #ebd3da;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  direction: rtl;
  font-family: 'Cairo', 'Almarai', system-ui, sans-serif;
}
.eclc-panel[hidden] { display: none; }
.eclc-panel.is-mobile { width: auto; }

.eclc-head { display: flex; align-items: center; justify-content: space-between; }
.eclc-title { font-weight: 700; font-size: 14px; }
.eclc-close {
  width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: transparent; font-size: 15px; cursor: pointer; color: #64748b;
}
.eclc-close:hover { background: #f1f5f9; }

.eclc-screen {
  background: #f7edf0;
  border: 1px solid #ebd3da;
  border-radius: 10px;
  padding: 6px 10px;
}
/* Chatwoot styles every input (grey box, faded text); the calculator screen overrides that */
.eclc-panel .eclc-input {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 22px !important;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a;
  padding: 2px 0 !important;
  box-sizing: border-box;
}
.eclc-preview {
  min-height: 18px;
  font-size: 13px;
  color: #64748b;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eclc-actions { display: flex; gap: 6px; }
.eclc-act {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
  padding: 7px 4px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: #0f172a;
}
.eclc-act:hover { border-color: var(--eclc-accent); }

.eclc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.eclc-key {
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  color: #0f172a;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.eclc-key:active { transform: scale(0.96); }
.eclc-key.eclc-op { background: #f7edf0; color: var(--eclc-accent); }
.eclc-key.eclc-fn { background: #e2e8f0; }
.eclc-key.eclc-eq { background: var(--eclc-accent); color: #fff; }

.eclc-hist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  padding-top: 2px;
}
.eclc-hist-clear {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.eclc-hist-clear:hover { color: #e11d48; }

.eclc-hist {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  flex-shrink: 0;
  max-height: 150px;
  overflow-y: auto;
}
.eclc-hist-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  border-inline-start: 3px solid transparent;
}
.eclc-hist-row:hover { background: #f8fafc; }
.eclc-hist-row.is-here { border-inline-start-color: var(--eclc-accent); }
.eclc-hist-line {
  font-size: 14px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.eclc-hist-meta { font-size: 11px; color: #94a3b8; }
.eclc-hist-empty { font-size: 12px; color: #94a3b8; padding: 6px 8px; }

.eclc-toast {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}
.eclc-toast[hidden] { display: none; }

.eclc-shake { animation: eclc-shake 0.3s; }
@keyframes eclc-shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (max-width: 767px) {
  .eclc-key { height: 46px; }
  .eclc-hist { max-height: 120px; }
}
