/* === Medha Support (embedded) === */
.support-shell {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.support-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #faf8ff, #f5f3ff);
}
.support-bar .sb-title {
  font-size: 14px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.support-bar .sb-title .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 3px rgba(16,185,129,.18);
}
.support-bar .sb-spacer { flex: 1; }
.support-bar .btn {
  padding: 7px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 700;
  border: 1.5px solid var(--border); background: #fff; color: var(--text);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.support-bar .btn:hover { background: var(--primary-bg); border-color: #ddd6fe; color: var(--primary); }
.support-bar .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.support-bar .btn.primary:hover { background: #4c1d95; color: #fff; }
.support-bar .btn svg { width: 14px; height: 14px; }

.support-frame-wrap {
  position: relative;
  height: calc(100vh - 330px);
  min-height: 480px;
  background: var(--bg-2);
}
.support-frame {
  width: 100%; height: 100%;
  border: 0; display: block;
  background: #fff;
}
.support-frame-wrap.loading::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #f8f7fc 25%, #f1eefb 50%, #f8f7fc 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* fallback panel when framing is blocked */
.support-blocked {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center;
  padding: 30px;
  background: #fff;
}
.support-blocked .sb-ico {
  width: 62px; height: 62px; border-radius: 18px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.support-blocked .sb-ico svg { width: 28px; height: 28px; }
.support-blocked h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--text); }
.support-blocked p { margin: 0; max-width: 460px; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.support-blocked .sb-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* credential card */
.support-creds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.cred-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  background: #fff;
}
.cred-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 5px;
}
.cred-value {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; color: var(--text); font-weight: 600;
  word-break: break-all; margin-bottom: 9px;
  display: flex; align-items: center; gap: 8px;
}
.cred-value .cv-text { flex: 1; }
.cred-btn {
  padding: 5px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 700;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text-muted);
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.cred-btn:hover { background: var(--primary-soft); color: var(--primary); border-color: #ddd6fe; }
.cred-btn.done { background: var(--success-soft); color: #047857; border-color: #a7f3d0; }
.cred-note { font-size: 11.5px; color: var(--text-muted); margin-top: 7px; line-height: 1.5; }
.cred-input {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1.5px solid var(--border);
  font-family: inherit; font-size: 13px; margin-bottom: 9px;
}
.cred-input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }

/* === Support mode tabs === */
.support-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sup-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: #fff;
  border: 1px solid var(--border);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sup-tab:hover:not(:disabled) { border-color: #ddd6fe; color: var(--primary); }
.sup-tab.active { background: var(--primary-soft); color: var(--primary); border-color: #ddd6fe; }
.sup-tab:disabled { opacity: .45; cursor: not-allowed; }
.sup-tab .st-ico { width: 15px; height: 15px; display: inline-flex; }
.sup-tab .st-ico svg { width: 15px; height: 15px; }
.sup-tabs-note { font-size: 12px; color: var(--text-dim); margin-left: 4px; }

/* === browser-like bar === */
.sb-nav { display: inline-flex; gap: 4px; color: var(--text-dim); }
.sb-nav svg { width: 16px; height: 16px; }
.sb-secure { display: inline-flex; color: #188038; }
.sb-secure svg { width: 14px; height: 14px; }
.sb-url {
  flex: 1;
  min-width: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-count {
  font-size: 11.5px; font-weight: 700; color: var(--primary);
  background: var(--primary-soft); padding: 3px 9px; border-radius: 999px;
}
.sb-search {
  padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border);
  font-family: inherit; font-size: 12.5px; min-width: 200px; background: #fff;
}
.sb-select {
  padding: 7px 10px; border-radius: 9px; border: 1px solid var(--border);
  font-family: inherit; font-size: 12.5px; background: #fff; color: var(--text);
}
.sb-search:focus, .sb-select:focus {
  outline: none; border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}

/* === native ticket table === */
.sup-table-wrap { overflow: auto; max-height: 62vh; }
.sup-tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.sup-tbl thead th {
  position: sticky; top: 0; z-index: 2;
  background: #faf9ff;
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sup-tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.sup-tbl tr:last-child td { border-bottom: none; }
.sup-tbl tr:hover td { background: #fbfaff; }
.sup-tbl .id-cell {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px; color: var(--primary); font-weight: 700; white-space: nowrap;
}
.sup-tbl .user-cell { color: var(--text); font-weight: 600; font-size: 12.5px; }
.sup-tbl .subj-cell { color: var(--text); max-width: 420px; }
.sup-tbl .age-cell { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

/* === Settings password gate === */
.gate-error {
  min-height: 18px; margin: 8px 0 0; font-size: 12.5px; font-weight: 700;
  color: var(--danger); opacity: 0; transition: opacity .18s ease;
}
.gate-error.show { opacity: 1; }
#settingsGate .modal { animation: cardIn .3s cubic-bezier(.2,.8,.25,1) both; }
#settingsGate .modal.shake { animation: shake .42s cubic-bezier(.36,.07,.19,.97) both; }

/* === Form Control panel === */
.fc-picker {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 16px;
  background: linear-gradient(135deg, #f0fdfa, #f5f3ff);
  border: 1px solid #99f6e4; border-radius: 12px;
}
.fc-picker label { font-size: 12.5px; font-weight: 800; color: #0f766e; }
.fc-picker select {
  flex: 1; min-width: 220px; padding: 9px 12px; border-radius: 9px;
  border: 1.5px solid #d6d3e8; font-family: inherit; font-size: 13px;
  font-weight: 600; color: var(--text); background: #fff;
}
.fc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.fc-wide { grid-column: 1 / -1; }
.fc-row { display: flex; flex-direction: column; gap: 6px; }
.fc-row label { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.fc-row input, .fc-row select, .fc-row textarea {
  width: 100%; padding: 10px 12px; border-radius: 9px;
  border: 1.5px solid var(--border); font-family: inherit; font-size: 13px; color: var(--text);
  background: #fff;
}
.fc-row textarea { resize: vertical; min-height: 70px; }
.fc-row input:focus, .fc-row select:focus, .fc-row textarea:focus {
  outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.fc-hint { font-size: 11px; color: var(--text-dim); }
.fc-status-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 16px;
  background: #faf9ff; border: 1px solid var(--border); border-radius: 12px;
}
.fc-status-row .fc-lbl { margin-right: 2px; }
.fc-lbl { font-size: 12.5px; font-weight: 800; color: var(--text-muted); }
#formControl .fc-btn {
  padding: 7px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 700;
  border: 1.5px solid var(--border); background: #fff; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0; line-height: 1.2;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
#formControl .fc-btn.open.active { background: #d1fae5; color: #047857; border-color: #6ee7b7; }
#formControl .fc-btn.close.active { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.fc-switch { position: relative; display: inline-block; width: 42px; height: 24px; margin-left: 4px; }
.fc-switch input { opacity: 0; width: 0; height: 0; }
.fc-switch .slider {
  position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px;
  transition: background .2s ease; cursor: pointer;
}
.fc-switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.fc-switch input:checked + .slider { background: var(--primary); }
.fc-switch input:checked + .slider::before { transform: translateX(18px); }
.fc-state { font-size: 13px; font-weight: 800; color: #059669; }
.fc-preview {
  border: 2px dashed #c4b5fd; border-radius: 12px; padding: 22px;
  background: #faf8ff; text-align: center;
}
.fc-lock {
  width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft);
  color: var(--primary); display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.fc-lock svg { width: 20px; height: 20px; }
.fc-prev-msg { font-size: 15px; font-weight: 700; color: var(--text); }
.fc-prev-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
#formControl .fc-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--border);
}
#formControl .fc-actions .btn-ghost.danger { color: var(--danger); }
#formControl .fc-actions .btn-ghost.danger:hover { background: #fef2f2; }
.fc-live {
  margin-top: 14px; padding: 11px 13px; border-radius: 10px;
  background: var(--bg-2); font-size: 12.5px; color: var(--text-muted);
}
@media (max-width: 640px) { .fc-grid { grid-template-columns: 1fr; } }

/* === Response status segmented control === */
.fc-segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #f1f0f7;
  border: 1px solid var(--border);
  border-radius: 11px;
  flex-shrink: 0;
}
.fc-seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.fc-seg svg { width: 13px; height: 13px; flex-shrink: 0; }
.fc-seg.open.active {
  background: #d1fae5; color: #047857; box-shadow: 0 1px 3px rgba(16,185,129,.25);
}
.fc-seg.close.active {
  background: #fee2e2; color: #b91c1c; box-shadow: 0 1px 3px rgba(220,38,38,.2);
}
.fc-seg:hover:not(.active) { color: var(--text); background: #fff; }
.fc-state {
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px;
  background: #f1f0f7; color: var(--text-muted);
}

.launch-check {
  background: none; border: none; padding: 0;
  font-size: 11.5px; font-weight: 600; color: var(--text-dim);
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer; align-self: flex-start;
}
.launch-check:hover { color: var(--primary); }
.launch-check:disabled { opacity: .5; cursor: default; }
