/* ===========================
   MSMS Canvas — single column UI
   =========================== */

.msms-wrap{
  --bg:#f6f8fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:rgba(15,23,42,.10);
  --line2:rgba(15,23,42,.06);
  --accent:#2563eb;
  --accent2:#1d4ed8;
  --ok:#15803d;
  --err:#b91c1c;

  width:100%;
  max-width:100%;
  background: var(--bg);
  padding: clamp(12px, 2vw, 22px);
  border-radius: 18px;

  display:flex;
  flex-direction:column;
  gap: 18px;
}

.msms-wrap, .msms-wrap *{ box-sizing:border-box; }

/* Cards */
.msms-card{
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(15,23,42,.08);
  padding: clamp(14px, 2vw, 22px);
}

/* Header */
.msms-card-head{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:14px;
}
.msms-h3{
  margin:0;
  font-size:16px;
  line-height:1.25;
  color: var(--text);
  letter-spacing:-0.01em;
}
.msms-status{ display:flex; flex-direction:column; gap:4px; }
.msms-info{ color: var(--ok); font-size:12px; }
.msms-err{ color: var(--err); font-size:12px; }

/* Controls grid */
.msms-controls-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items:start;
}
@media (max-width: 980px){
  .msms-controls-grid{ grid-template-columns: 1fr; }
}

.msms-row-wide{ grid-column: 1 / -1; }

/* Row inline (Peptide) */
.msms-row{
  display:flex;
  align-items:center;
  gap:10px;
}
.msms-label-inline{
  font-size:12px;
  font-weight:900;
  color: var(--muted);
  min-width: 64px;
}
.msms-len{
  font-size:12px;
  color: var(--muted);
  white-space:nowrap;
}

/* Fields */
.msms-field{ display:flex; flex-direction:column; }

.msms-label{
  font-size:12px;
  color: var(--muted);
  margin-bottom:6px;
  font-weight:900;
}

/* Inputs */
.msms-input{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  font-size:13px;
  color: var(--text);
  background:#fff;
  outline:none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.msms-input:hover{ border-color: rgba(37,99,235,.30); }
.msms-input:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.msms-input::placeholder{ color:#94a3b8; }

.msms-input-pep{
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing:.02em;
}

/* N-ter / C-ter row */
.msms-grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 980px){
  .msms-grid2{ grid-template-columns: 1fr; }
}

/* Help */
.msms-help{
  font-size:12px;
  color: var(--muted);
  line-height:1.35;
}
.msms-help-inline{
  margin-left: 8px;
  white-space:nowrap;
}

/* Soft options */
.msms-soft{
  background:#f8fafc;
  border:1px solid var(--line2);
  border-radius:16px;
  padding:12px;
}
.msms-soft-title{
  font-weight:900;
  font-size:12px;
  color: var(--text);
  margin-bottom:10px;
}
.msms-opts-inline{
  display:flex;
  flex-wrap:wrap;
  gap:10px 16px;
}
.msms-check{
  font-size:13px;
  color: var(--text);
}
.msms-check input{ transform: translateY(1px); }

/* Buttons */
.msms-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
}
.msms-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  border-radius:14px;
  padding:10px 14px;

  border:1px solid var(--line);
  background:#f1f5f9;
  cursor:pointer;

  font-size:13px;
  font-weight:900;
  color: var(--text);

  transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
}
.msms-btn:hover{
  background:#eaf0f8;
  box-shadow:0 10px 18px rgba(15,23,42,.08);
}
.msms-btn:active{ transform: translateY(1px); }
.msms-btn-primary{
  background: var(--accent);
  border-color: rgba(37,99,235,.35);
  color:#fff;
}
.msms-btn-primary:hover{ background: var(--accent2); }
.msms-btn:disabled{ opacity:.55; cursor:not-allowed; box-shadow:none; }

/* Card topbar */
.msms-card-topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}
.msms-card-title{
  font-weight:900;
  font-size:13px;
  color: var(--text);
}
.msms-toolbar{ display:flex; gap:10px; }

/* Canvas */
#msms-canvas{
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  border-radius:14px;
  min-height: 320px;
}

/* Tables */
.msms-table{
  width:100%;
  border-collapse:collapse;
}
.msms-table th, .msms-table td{
  border-bottom:1px solid rgba(15,23,42,.08);
  padding:5px 6px;
  vertical-align:top;
  color: var(--text);
  font-size: 10.5px;     /* réduit */
  line-height: 1.2;
}
.msms-table th{
  color: var(--muted);
  font-weight:900;
  font-size: 10.5px;
}
.msms-table tr:hover td{ background: rgba(37,99,235,.04); }

/* Top60: 9 columns, monospace on annotations */
.msms-top60 td:nth-child(3),
.msms-top60 td:nth-child(6),
.msms-top60 td:nth-child(9){
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  overflow-wrap:anywhere;
  white-space:normal;
}

/* Ion mass table (generated) — smaller */
.msms-masstable{
  width:100%;
  border-collapse:collapse;
}
.msms-masstable th, .msms-masstable td{
  border-bottom:1px solid rgba(15,23,42,.08);
  padding: 4px 6px;
  font-size: 9.8px;      /* plus petit */
  line-height: 1.15;
}
.msms-mid{ text-align:center; }
.msms-aa{
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-weight:900;
}

/* Toast */
.msms-toast{
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #0f172a;
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 9999;
}
.msms-toast.is-on{ opacity: 1; transform: translateY(0); }
.msms-toast-err{ background: #991b1b; }
